Construction of an emotion perception model and early depression risk detection method

By constructing an emotion perception model, combining emotional knowledge graphs and depression symptoms knowledge, the problem of the existing technology being difficult to identify users in the early stages of depression is solved, and the accurate assessment and detection of the risk of early depression is achieved.

CN119132598BActive Publication Date: 2025-04-08SICHUAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411195918.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2025-04-08
Estimated Expiration
2044-08-29

AI Technical Summary

Technical Problem

Existing depression detection methods are difficult to effectively identify users in the early stages of depression, and they ignore key information such as emotional knowledge, field knowledge of depression and negative emotions severity.

Method used

A emotion perception model is constructed, and the data set, post presentation layer, user presentation layer and detection layer are constructed, combined with emotional knowledge graph, depression symptoms knowledge and pre-trained language model, to detect users' early depression risks.

Benefits of technology

Accurate assessment of user risks in the early stages of depression is achieved, and the accuracy and effectiveness of detection are fully integrated through multi-level knowledge fusion strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119132598B_ABST
    Figure CN119132598B_ABST
Patent Text Reader

Abstract

The present invention provides a method for constructing an emotion perception model and detecting the risk of early depression, which solves the problem that the emotion content and early description of depression symptoms expressed by users in social media are ignored in the existing methods, making it difficult to accurately judge whether the user is already in the early stage of depression. The present invention constructs a data set, obtains a social media dynamic data set of a user to be detected and obtains a set of early description posts of depression of the user to be detected containing at least one content; constructs the post representation layer, and uses a pre-trained language model to capture a context representation sequence that integrates negative emotion knowledge; constructs the user representation layer, and obtains a user representation matrix that integrates heterogeneous knowledge based on the output of the post representation layer; predicts the early depression risk level of the user to be detected through the detection layer; and obtains the emotion perception model after training, which can effectively detect and evaluate users with early depression.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of data processing, and in particular to the construction of an emotion perception model and an early depression risk detection method. Background Art

[0002] According to the World Health Organization, there are currently more than 350 million people suffering from depression worldwide, and the number of patients has increased at a rate of about 18% over the past decade. It is estimated that depression will become the leading cause of disability in 2030. However, less than half of people suffering from depression worldwide receive necessary treatment, and in some countries, this proportion has even dropped to less than 10%. This may be attributed to the fact that the traditional diagnosis of depression requires face-to-face communication between patients and doctors, thus limiting the possibility of identifying potential patients. In addition, individuals with depression often take a wait-and-see attitude in seeking professional help due to insufficient understanding of their own illness or inner struggles, causing them to miss the best time for intervention and treatment.

[0003] With the booming development of social media, the massive amount of user posting data has brought hope for early detection of users with depression. However, the data currently relied on for depression detection mainly comes from users who have been suffering from the disease for a long time. Their statements are full of significant negative depressive emotions, making it difficult to use them to determine whether users are in the early stages of depression. In addition, existing methods mainly focus on modeling semantic information of post texts, but ignore key information such as emotional knowledge, depression domain knowledge, and the severity of negative emotions. Summary of the invention

[0004] One of the embodiments of this specification provides a method for constructing an emotion perception model and detecting the risk of early depression. The method for constructing the emotion perception model includes:

[0005] Constructing a data set, obtaining a social media dynamic data set of the user to be detected, performing preprocessing based on the social media dynamic data set, and obtaining a set of early depression description posts containing at least one content and an early depression risk label of the user to be detected;

[0006] Constructing the post representation layer, constructing a domain corpus with negative sentiment knowledge based on the sentiment knowledge graph, and using a pre-trained language model to capture a context representation sequence that incorporates negative sentiment knowledge;

[0007] Constructing the user representation layer, constructing a user-level post-symptom heterogeneous graph in combination with depression symptom knowledge, and obtaining a user representation matrix integrating heterogeneous knowledge based on the output of the post representation layer;

[0008] Building the detection layer, which is composed of a Softmax function and a loss function, and predicting the early depression risk level of the user to be detected based on the user representation matrix input into the detection layer;

[0009] The emotion perception model is obtained by training based on the loss function.

[0010] In some embodiments, the construction of the emotion perception model further includes:

[0011] The social media dynamic data set is preprocessed to obtain a true label of the severity of the negative emotion of the user to be detected.

[0012] In some embodiments, the construction of the emotion perception model may further include:

[0013] The detection layer includes at least one Softmax function and at least one loss function;

[0014] Inputting the user representation matrix into a first Softmax function to obtain the early depression risk level of the user to be detected;

[0015] Inputting the early depression risk level and the early depression risk label into a first loss function to obtain a first loss value;

[0016] Inputting the user representation matrix into a second Softmax function to obtain the overall negative emotion level of the user to be detected;

[0017] Inputting the true label of the severity of the negative emotion and the overall negative emotion level into a second loss function to obtain a second loss value;

[0018] The first loss value and the second loss value are superimposed to construct the loss function for model training to obtain the final emotion perception model.

[0019] One of the embodiments of this specification provides a method for detecting the risk of early depression, comprising:

[0020] Obtain a social media dynamics dataset of target users;

[0021] Preprocessing the social media dynamic data set to obtain a post set of the target user containing at least one emotional content;

[0022] The post set is input into a trained emotion perception model to predict the early depression risk level of the target user, wherein the emotion perception model is composed of a post representation layer, a user representation layer and a detection layer.

[0023] The beneficial effects of the present invention include:

[0024] (1) Depression detection is redefined as an early depression risk detection task, and an early depression risk detection dataset is constructed to assess the risk of users being in the early stages of depression.

[0025] (2) In order to fully and effectively utilize emotional knowledge and depression domain knowledge, the present invention proposes an emotional perception model that integrates heterogeneous knowledge for early depression detection. The model uses a multi-level knowledge fusion strategy to fully integrate emotional knowledge and depression domain knowledge at the post level and user level, thereby deeply understanding the implicit information of users in the early stages of depression.

[0026] (3) In order to enable the model to effectively perceive the severity of the user's negative emotions, the present invention also proposes an auxiliary task for detecting the severity of the user's negative emotions. Through this task, the model can effectively perceive the severity of the user's overall negative emotions, thereby more accurately detecting users with early depression.

[0027] (4) Experimental results show that the emotion perception model proposed in this paper achieves state-of-the-art performance and can effectively assess the risk of users being in the early stages of depression. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] This specification will be further described in the form of exemplary embodiments, which will be described in detail by the accompanying drawings. These embodiments are not restrictive, and in these embodiments, the same number represents the same structure, wherein:

[0029] Figure 1 is a flowchart of a method for constructing an emotion perception model according to some embodiments of this specification;

[0030] Figure 2 is an exemplary structural diagram of an emotion perception model according to some embodiments of this specification;

[0031] Figure 3 is an exemplary flow chart of a method for detecting early depression risk according to some embodiments of this specification;

[0032] Figure 4 is an experimental performance comparison chart of the effectiveness of the selection of training data sets shown in some embodiments of this specification;

[0033] Figure 5 It is an explanation correspondence diagram generated based on the depression symptom phrases and their corresponding LLMs shown in some embodiments of this specification. DETAILED DESCRIPTION

[0034] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the following is a brief introduction to the drawings required for the description of the embodiments. Obviously, the drawings described below are only some examples or embodiments of this specification. For ordinary technicians in this field, this specification can also be applied to other similar scenarios based on these drawings without creative work. Unless it is obvious from the language environment or otherwise explained, the same reference numerals in the figures represent the same structure or operation.

[0035] It should be understood that the "system", "device", "unit" and / or "module" used herein are a method for distinguishing different components, elements, parts, portions or assemblies at different levels. However, if other words can achieve the same purpose, the words can be replaced by other expressions.

[0036] As shown in this specification and claims, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the terms "comprise" and "include" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.

[0037] Flowcharts are used in this specification to illustrate the operations performed by the system according to the embodiments of this specification. It should be understood that the preceding or following operations are not necessarily performed precisely in order. Instead, the steps may be processed in reverse order or simultaneously. At the same time, other operations may also be added to these processes, or one or more operations may be removed from these processes.

[0038] Figure 1 is a flowchart of a method for constructing an emotion perception model according to some embodiments of this specification, such as Figure 1 As shown, the process of the method for constructing the emotion perception model includes the following steps.

[0039] S101, constructing a data set, obtaining a social media dynamic data set of a user to be detected, performing preprocessing based on the social media dynamic data set, and obtaining a set of early depression description posts containing at least one content and an early depression risk label of the user to be detected.

[0040] In some embodiments, the social media dynamic data set of the user to be detected includes: user basic information, post set, and at least one data attribute of a publishing timestamp.

[0041] In some embodiments, the data set can be obtained in a variety of ways, for example, using an existing constructed data set such as WU3D, EDR2D w / o MP, etc., or re-cleaning and re-constructing the existing data set.

[0042] In some embodiments, the present invention is based on WU3D as a data source, which contains comprehensive information of 10,325 depressed users and 22,245 normal users. The data of each user includes multiple data attributes such as user basic information, post set, and release timestamp. Since there are many problematic data in the WU3D dataset, the present invention further preprocesses and constructs an Early Depression Risk Detection Dataset (EDR2D) based on Chinese social media.

[0043] In some embodiments, the step of obtaining a set of early description posts of depression includes:

[0044] Based on a preset list of relevant keywords, the abnormal user data in the social media dynamic data set is automatically removed.

[0045] Based on the publishing timestamp attribute of posts, the posts in the social media dynamics dataset are rearranged to obtain a time-ordered post set sequence.

[0046] The first post containing key information in the post set is located as the final post, and the posts after the final post are removed to obtain a post set containing at least one content that describes early stages of depression.

[0047] In some embodiments, the present invention manually reviews the data set and automatically removes abnormal user data including advertising users, non-personal users, robot users, and users who spread bad information by designing a list of relevant keywords. Furthermore, the present invention uses the posting timestamp attribute of the post to rearrange the user's post set in chronological order.

[0048] In some embodiments, for depressed users, the present invention first locates the first post that mentions key content such as depression, self-reported diagnosis history, and the name of the drug used to treat depression as the final post, and then removes all remaining posts after this post, thereby forming a collection of posts with early-stage depression-related descriptions.

[0049] In some embodiments, the present invention can also clean and remove irrelevant user data. If the number of filtered posts is less than 10, and it is considered that the content is not sufficient to accurately analyze the risk of the user being in the early stage of depression, such user data is removed.

[0050] In some embodiments, the step of obtaining an early depression risk signature comprises:

[0051] Sliding and intercepting the set of posts describing early depression based on a preset time period to obtain at least one analysis window;

[0052] Obtain the weighted negative sentiment value of the post set in each analysis window based on the sentiment knowledge graph;

[0053] Determine the comprehensive weight of each analysis window based on the number of posts in each analysis window and the time sequence of the posts;

[0054] The weighted negative sentiment value of the post set in each analysis window is multiplied by the comprehensive weight and added together to obtain the early depression risk score value;

[0055] An early depression risk signature is determined based on the early depression risk score value.

[0056] In some embodiments, according to the latest International Classification of Diseases, 11th revision (ICD-11), the duration of depression symptoms is "at least two weeks", therefore, the present invention uses a sliding window technique to intercept all posts of the user for 14 consecutive days as an analysis window. Based on all posts within the analysis window, the negative sentiment value of the window is calculated.

[0057] Specifically, the present invention performs word segmentation on each post text, and then uses the sentiment knowledge graph SenticNet to obtain the polarity value of each word with negative sentiment, accumulates the polarity values ​​of these words and takes the average value as the negative sentiment value of the post. The negative sentiment value of all posts in the window is accumulated and averaged. Note that if a user posts multiple posts in one day, the negative sentiment value of all posts in that day is accumulated and averaged as the negative sentiment value of that day.

[0058] Furthermore, for ordinary users, the present invention also designs an automatic re-labeling scheme to improve the accuracy and reliability of early depression risk assessment by comprehensively considering time factors, user activity level, depression risk score, and the number and distribution of posts.

[0059] Specifically, different time weights are first assigned to different analysis windows. It is believed that posts closer to the current date can better reflect the user's latest mental state. Therefore, the analysis window closer to the latest date is assigned a higher weight score. The specific calculation formula for the weight score is as follows:

[0060]

[0061] in, is the time weight of the ith window, is the total number of days covered by the post set of user u, is the number of days from the latest date to the start date of this analysis window.

[0062] Next, different active weights are assigned to different windows. The present invention believes that the active posting behavior of user u may be closely related to emotional expression, so the more posts user u posts, the higher the importance of the window. The specific calculation formula is as follows:

[0063]

[0064] in, is the active weight of the ith window, is the number of posts in this window, is the maximum number of posts in all analysis windows. Finally, the comprehensive weight of the analysis window is calculated based on the time weighting and the number of posts.

[0065]

[0066] in, is the comprehensive weight of the i-th window. Then, for each user, the weighted negative emotion values ​​of all analysis windows are added together to obtain the user's early depression risk score. The specific calculation process is as follows:

[0067]

[0068] in, Early depression risk score of user u. Finally, based on data statistics and observations, users with early depression risk scores below 0.36 are marked as low, while users with scores above 0.86 are marked as high. For users with scores between [0.36, 0.86], they are marked as medium. For depressed users, their risk level is marked as high.

[0069] In addition, in order to ensure the accuracy of the labeling results, the present invention invites domain experts to manually proofread the automated labeling results of the EDR2D dataset.

[0070] The EDR2D and the processing of the data set proposed in this embodiment are a preferred method of the method proposed in the present invention. In order to verify the effectiveness of the EDR2D proposed in the present invention, the WU3D data set was relabeled for depression risk according to the automated relabeling scheme, and then the SM-HK trained on WU3D, EDR2D w / oMP (EDR2D without manual proofreading) and EDR2D were compared. Figure 4This is an experimental performance comparison chart of the effectiveness of the selection of training data sets shown in some embodiments of this specification. It can be seen that the performance of SM-HK benefits from the posts selected after manual proofreading, and the accuracy is 6.81% higher than that on the original WU3D, and the multi-label evaluation index (macro-F1) is 3.61% higher.

[0071] Although the performance of the model on EDR2D w / o MP has declined, it is still 5.26% higher than the original WU3D in accuracy and 2.78% higher in macro-F1. We believe that the reason is that there are many low-quality data such as advertising users, non-personal users and robot users in the original WU3D. At the same time, the dataset also contains many explicit depression expressions of users with severe depression. This makes it difficult for SM-HK to fully learn the characteristics of users with early depression. These results also show that the EDR2D proposed in the present invention is more conducive to predicting the risk of users being at early depression.

[0072] S102, constructing the post representation layer, constructing a domain corpus with negative emotional knowledge based on the emotional knowledge graph, and using a pre-trained language model to capture a context representation sequence that integrates negative emotional knowledge.

[0073] In some embodiments, the emotion perception model of the present invention is an emotion perception model integrating heterogeneous knowledge (SM-HK), which consists of three layers: a post representation layer, a user representation layer, and a detection layer. Figure 2 Shown is an exemplary structural diagram of the emotion perception model shown in some embodiments of this specification.

[0074] Specifically, first, the post representation layer uses the sentiment-enhanced domain fine-tuning method and combines the sentiment knowledge graph to build a domain corpus with negative sentiment knowledge, thereby fine-tuning the pretrained language model (PLMs) to capture the post representation that incorporates negative sentiment knowledge. Among them, the pretrained language model (PLMs) is a language model pre-trained in a self-supervised manner on a large-scale corpus.

[0075] Next, the user representation layer uses a heterogeneous knowledge fusion method to combine depression symptom knowledge and Large Language Model (LLM) enhanced knowledge to construct a post-symptom heterogeneous graph. Among them, the Large Language Model (LLM) is a model trained with massive texts, capable of recognizing human language, performing language tasks, and having a large number of parameters. Then, the graph attention network encoding is used to capture the user representation of the fused heterogeneous knowledge. Finally, the detection layer effectively predicts the risk level of the user in the early stage of depression.

[0076] In some embodiments, the specific steps of building the post presentation layer include:

[0077] Generate negative emotion auxiliary sentences using the emotion knowledge graph and build a domain corpus with negative emotion knowledge;

[0078] Determining the severity of negative emotion of each word based on the attribute value of each word in the domain corpus of negative emotion knowledge;

[0079] Using the severity of the negative emotion of the vocabulary to construct negative emotion auxiliary sentences related to the vocabulary, further obtaining a domain corpus with negative emotion knowledge;

[0080] Performing domain fine-tuning based on the domain corpus of the negative emotion knowledge to obtain a pre-trained model for emotion enhancement;

[0081] The emotion-enhanced pre-trained model is used as an encoder to encode the set of early depression description posts to obtain a contextual representation that incorporates negative emotion knowledge.

[0082] In some embodiments, the method of the present invention first generates negative emotion auxiliary sentences using the emotion knowledge graph to construct a domain corpus with negative emotion knowledge.

[0083] Specifically, we use the sentiment knowledge graph SenticNet as the sentiment knowledge source, which contains 100,000 concepts related to sentiment and polarity. i Any verb or noun in j , using the word as a keyword to find out whether its attribute “polarity_label” in SenticNet is negative.

[0084] Next, we use the attribute "polarity_value" to determine the word w with negative polarity. j Severity of emotion j When the value of the attribute "polarity_value" belongs to (-0.25, 0], the corresponding severity j If the value is (-0.55, -0.25], then severity j is "medium"; and when the value belongs to (-1, -0.55], the corresponding severity j is “serious”.

[0085] Then, we use the severity j To construct the word w j Related auxiliary statements auxj , specifically "word 'w j 'May have severity j Negative emotions. ". For post p i For all the verbs and nouns with negative polarity, we use the above method to generate the corresponding negative sentiment auxiliary sentences, and then splice these negative sentiment auxiliary sentences into the post p in turn. i Later, we get enhanced sentences with negative sentiment knowledge

[0086] Finally, we obtain the domain corpus with negative sentiment knowledge (DC-NSK) based on all user posts in the EDR2D training set through the above method.

[0087] Furthermore, the method of the present invention uses the dataset to perform domain fine-tuning to obtain a pre-trained model for emotion enhancement, so as to obtain a post representation that integrates negative emotion knowledge. Specifically, the present invention adopts the Masked LM task proposed by Devlin et al. (Devlin J, Chang MW, Lee K, et al. Bert: Pre-training of deep bidirectional transformers for language understanding [J]). For all enhanced sentences in 2D-NSK, the pre-trained model randomly selects some tokens for prediction. Among these selected tokens, 80% are replaced with [MASK] tokens, 10% are replaced with random tokens, and the remaining 10% remain unchanged. Finally, after the above-mentioned domain fine-tuning, a pre-trained model for emotion enhancement is obtained.

[0088] In order to obtain the representation of all posts of a user, the post representation layer uses the sentiment-enhanced pre-trained model as an encoder for encoding. Specifically, we first need to encode the post p i Constructed as input sequence q i , then the sequence q i Input the sentiment enhancement pre-trained model and use the fully connected layer to perform dimensionality reduction and average pooling to obtain the post p i Contextual representation of the fusion of negative sentiment knowledge The calculation process is as follows:

[0089] q i ="[CLS]"+p i + ″[SEP]″ (5),

[0090]

[0091]

[0092] in, Finally, by calculating the n posts in the post set P according to the above formula, we can get the contextual representation of the post set P that integrates negative sentiment knowledge:

[0093]

[0094] The beneficial effect of step S102 is that in the early stages of depression, users often show fewer and milder symptoms of depression, so most of their posts do not contain significant depression-related negative emotions, and some expressions are also more obscure. This makes it difficult for existing models to determine whether a user is in the early stages of depression. Since emotional knowledge aggregates people's cognition and understanding of the emotions they have for different things, it can further help the model understand the emotional tendencies under implicit expressions. Therefore, the post representation layer uses the domain fine-tuning method of emotional enhancement to help the model learn the deep emotional expression of each user's post.

[0095] S103, constructing the user representation layer, constructing a user-level post-symptom heterogeneous graph in combination with depression symptom knowledge, and obtaining a user representation matrix integrating heterogeneous knowledge based on the output of the post representation layer.

[0096] In some embodiments, the specific steps of building the user representation layer include:

[0097] Construct a semantic representation vector set of depression symptom nodes based on depression knowledge;

[0098] Based on the semantic representation vector set of the depression symptom nodes, by calculating the semantic similarity corresponding to each post in the early description post set of depression, a depression symptom node set corresponding to each post is determined;

[0099] Based on the depressive symptom node set and the contextual representation fused with negative emotion knowledge, a user-level post-symptom heterogeneous graph is constructed through a heterogeneous knowledge fusion method;

[0100] Based on the post-symptom heterogeneous graph, a graph attention network is applied to aggregate adjacent nodes to obtain a heterogeneous representation of the set of posts describing early depression;

[0101] The heterogeneous representation is input into a multi-layer perceptron after dimension reduction through a fully connected layer to obtain a user representation matrix that integrates heterogeneous knowledge.

[0102] In some embodiments, the present invention uses the latest authoritative medical document "International Classification of Diseases" 11th revision (ICD-11) as a source of knowledge on depression symptoms, which describes the characteristics of depression as low mood accompanied by cognitive, behavioral or neuromuscular disorders that have a significant impact on an individual's daily functioning.

[0103] Furthermore, we first extracted 11 characteristic description phrases about depression in ICD-11 as the depression symptom node set. For example, "low mood", "decreased interest in activities" and "feeling of worthlessness". However, since these phrases related to depression symptoms lack sufficient contextual information, the semantic representation after PLM encoding may not be accurate enough. Taking into account that LLMs such as ChatGPT have rich knowledge and powerful semantic understanding capabilities, the present invention uses LLM to add relevant explanatory text to these symptom phrases. For example, the explanatory text for "low mood" is "It is used to describe someone's bad mood and lack of energy. When a person is in a low mood, they may feel frustrated, sad, helpless, or lack motivation and interest." For details, please refer to Figure 5 Depressive symptom phrases and their corresponding LLM-generated explanations are shown.

[0104] Furthermore, the generated interpretation text is input into PLM to obtain a more accurate semantic representation of the depressive symptom node. In order to accurately identify the symptoms of depression exhibited by users, a depression symptom node that matches the user's post is matched.

[0105] Specifically, the post p i According to formulas (5), (6) and (7), the context representation is obtained. Then, calculate H with 11 depression symptom nodes ds The semantic similarity score of And select the top k symptom nodes with the highest scores as posts p i The corresponding symptom node of , thus obtaining a symptom node set of length k Among them, the semantic similarity score The calculation process is as follows:

[0106]

[0107] Finally, we perform the above calculations for all posts in the post set P to obtain the symptom node set corresponding to each post. Note that since not every post of a user expresses content related to depression symptoms, we set a symptom threshold T here. ds If the semantic similarity score Greater than or equal to T ds , the symptom node is included in the symptom node set. Otherwise, the relevant symptom node is ignored.

[0108] In some embodiments, in order to better utilize negative emotion knowledge and depression symptom knowledge, a heterogeneous knowledge fusion method constructs a user-level post-symptom heterogeneous graph.

[0109] Specifically, first, since the user's posts have been arranged in chronological order when constructing the dataset EDR2D, an edge can be added in sequence according to the order of posts in the post set P to construct a post graph with a chronological development order as the root graph. Then, since there is incoherence in the related topics of user posts, that is, different posts on the same topic may be separated by multiple posts on other topics, the present invention matches each post with a post that has a high relevance to its topic.

[0110] Specifically, by calculating the post p i Contextual representation of In context with other posts Semantic similarity score And select the top k post nodes with the highest score as post p i The similar topic post nodes are then added to the post graph to create an edge between the two post nodes. The calculation process is as follows:

[0111]

[0112] Note that since not every post of a user necessarily has other posts belonging to the same topic, a topic threshold T is set here. tp If the semantic similarity score Greater than or equal to T tp , add an edge between the two post nodes. Otherwise, ignore the post node with similar topic.

[0113] Furthermore, for post p i The corresponding symptom node set All symptom nodes in the post node are connected by adding an edge to each other; finally, after completing the above expansion steps for all post nodes in the user's post set P, a post-symptom heterogeneous graph PSHG can be obtained, whose node set is Where e∈[n,E],E=n+11, the adjacency matrix A of the post-symptom heterogeneous graph PSHG is expressed as:

[0114]

[0115] In some embodiments, in order to fully integrate three kinds of heterogeneous knowledge, namely, post semantic knowledge, negative emotion knowledge, and depression symptom knowledge, the present invention applies a graph attention network based on the post-symptom heterogeneous graph PSHG to aggregate heterogeneous representations of adjacent nodes.

[0116] Specifically, the contextual representation of the post set P that integrates negative emotional knowledge and the semantic representation of the depression symptom nodes related to the user's post are first connected as the initial node representation of PSHG.

[0117] Next, the initial node of PSHG is represented by H hg,0 and its adjacency matrix A are input into the graph attention network GAT to aggregate the adjacent node information through multi-head attention to update the node representation. This enables each node in the graph to learn important heterogeneous information such as semantics, negative emotions, and depression symptoms from its adjacent nodes. Among them, for the i-th node in PSHG The update process is as follows:

[0118]

[0119]

[0120] in, is the normalized attention coefficient calculated by the vth attention mechanism, Attention(h i ,h j ) represents dot-product attention. is the heterogeneous representation of the i-th node after GAT update, Indicates that from h v to h V Vector concatenation operation, is the transformation matrix.

[0121] After aggregation by the graph attention network, we obtain the heterogeneous representation of PSHG nodes that aggregates rich semantic information and multiple knowledge.

[0122] Finally, we will represent the heterogeneous hg,1 After the dimension reduction by the fully connected layer, it is input into a multi-layer perceptron (MLP) to obtain the final user representation H fin The calculation results are as follows:

[0123] H fin =MLP(W fin H hg,1 +b fin ) (13),

[0124] Among them, W fin is the trainable weight, b fin is the bias vector.

[0125] The beneficial effect of step S103 is that the knowledge of depression symptoms is introduced to assist the model to more accurately notice the user's performance related to depression, thereby more effectively perceiving the severity of the user's overall negative emotions and more accurately detecting early-stage depression users.

[0126] S104, constructing the detection layer, which is composed of a Softmax function and a loss function, and predicting the early depression risk level of the user to be detected based on the user representation matrix input into the detection layer.

[0127] In some embodiments, the final user representation H fin Input Softmax layer to get the risk level R of user u u

[0128] R u =Softmax(H fin ) (14),

[0129] in, and is the early depression risk level and early depression risk label of the i-th sample obtained through model prediction.

[0130] S105, performing training based on the loss function to obtain the emotion perception model.

[0131] In some embodiments, cross entropy with L2 regularization is used as the loss function for this task:

[0132]

[0133] After training, the model parameters are continuously adjusted to obtain the emotional perception model required for training.

[0134] In some embodiments, considering the difference in negative emotion levels between depression users and normal users, the difference in the severity of negative emotions can help the model notice early depression users based on the overall negative emotion level of the user over a period of time. Therefore, the present invention proposes an auxiliary task called user negative emotion severity detection. This task is highly related to the main task and can help the model effectively perceive the overall severity of the user's negative emotions and improve the accuracy of the model's prediction.

[0135] In some embodiments, the construction of the emotion perception model proposed by the present invention further includes:

[0136] The social media dynamic data set is preprocessed to obtain a true label of the severity of the negative emotion of the user to be detected.

[0137] In some embodiments, obtaining the true label of the severity of the negative emotion of the user to be detected also includes using the emotional knowledge graph SenticNet as the emotional knowledge source, which contains 100,000 concepts related to emotion and polarity. i Take any verb or noun in the sentence, and use the word as a keyword to find out whether its attribute "polarity_label" in SenticNet is negative. Then, add up the values ​​of the attribute "polarity_value" of the related words and take the average as the negative sentiment value of the post. Furthermore, add up the negative sentiment values ​​of all posts of user u and take the average as the overall negative sentiment value of user u. When the value of the attribute "polarity_value" belongs to (-0.25,0], the corresponding severity j If the value is (-0.55,-0.25], then severity j is "medium"; and when the value belongs to (-1, -0.55], the corresponding severity j is "serious". Thus, the real label of the severity of the negative emotion of the user to be detected is obtained. To ensure the rationality of the label, the present invention also invites experts in the field to perform manual inspection and proofreading.

[0138] In some embodiments, the process of obtaining the negative sentiment value of a post of user u may include the following steps: for user post i, first segment it using the natural language processing tool spacy, assuming it is divided into n words, and then use these words as keywords in turn to search in the sentiment knowledge graph SenticNet. If the word exists in SenticNet, then obtain the sentiment value corresponding to the word.

[0139] In some embodiments, the detection layer includes at least one Softmax function and at least one loss function;

[0140] Inputting the user representation matrix into a first Softmax function to obtain the early depression risk level of the user to be detected;

[0141] Inputting the early depression risk level and the early depression risk label into a first loss function to obtain a first loss value;

[0142] Inputting the user representation matrix into a second Softmax function to obtain the overall negative emotion level of the user to be detected;

[0143] Inputting the true label of the severity of the negative emotion and the overall negative emotion level into a second loss function to obtain a second loss value;

[0144] The first loss value and the second loss value are superimposed to construct a complete loss function for model training to obtain the final emotion perception model.

[0145] Specifically, during the model training process, in the training phase, the detection layer obtains the final user representation H fin Input two Softmax layers at the same time, as described above, input the first Softmax layer to obtain the risk level R of user u u , you can also input the second Softmax layer to get the severity of user u’s negative emotion SE u , specifically expressed as:

[0146] SE u =Softmax(H fin ) (16).

[0147] Furthermore, the result is input into the second loss function:

[0148]

[0149] Where I is the number of training samples, and is the true label of the severity of negative emotion of the i-th sample and the predicted label of the severity of negative emotion obtained by the model, λ is the coefficient of L2-regularization, and Θ represents all trainable parameters.

[0150] Furthermore, the loss values ​​obtained by the two loss functions are superimposed to construct a complete loss function:

[0151] Loss=Loss rp +εLoss aux (18)

[0152] Among them, ε is a hyperparameter used to control the impact of auxiliary tasks on the model. After the training is completed, the required emotion perception model is obtained.

[0153] In some embodiments, in order to verify the performance of the emotion perception model (SM-HK) proposed in the present invention for early depression risk detection, the present invention also conducted a test experiment on the proposed EDR2D.

[0154] In the dataset EDR2D constructed by the present invention, each user's data contains multiple posts, and the early depression risk detection corresponding to each user is low, medium or high, and the corresponding negative emotion severity is mild, medium or severe. Table 1 shows the statistical data of the dataset.

[0155] Table 1: Statistics of EDR2D

[0156]

[0157] In addition, the present invention uses two indicators, accuracy and macro-F1, as evaluation indicators to evaluate the performance of SM-HK and other baseline models.

[0158] For the post text, the present invention uses the SpaCy parsing tool for syntactic parsing to obtain word segmentation and part of speech. In addition, bert-chinese is used as the pre-trained language model BERT, and GPT-4.0-Turbo is used to generate the LLM of the explanation text of the symptom phrase. The further proposed SM-HK is implemented using the PyTorch framework and trained on the NVIDIA GeForceRTX 4090. The weight matrix of SM-HK is initialized using Xavier and the Adam optimizer is used with a 1×10 -7 The present invention uses a learning rate of 2×10 -6 BERT is fine-tuned on EDR2D with a learning rate of . The topic threshold T in SM-HK tp is 0.86, and the symptom threshold T ds is 0.85, and k for selecting child nodes is 3. ε in the loss function is set to 0.5. All these parameters are determined through parameter optimization experiments.

[0159] Furthermore, in order to verify the effectiveness of the emotion perception model SM-HK proposed in this invention, this experiment re-implemented some advanced PLMs and LLMs on EDR2D and compared them with it.

[0160] 1) BERT: Use BERT as a post encoder to obtain the contextual semantic representation of each post of a user.

[0161] 2) BERT+BiLSTM: The BERT-encoded representation of each post of the user is input into BiLSTM to obtain the contextual semantic representation of the post.

[0162] 3) BERT+BiLSTM+Att: The BERT-encoded representation of each post of the user is input into BiLSTM and passed through an attention layer to obtain the attention-enhanced contextual semantic representation of the post.

[0163] 4) BERT+GCN: Use GCN to capture the overall post context semantic representation of users through the order in which they post.

[0164] 5) BERT+GAT: Use GAT to capture the overall post context semantic representation of users through the order in which they post.

[0165] 6) ERNIE 3.5: A knowledge-enhanced large language model developed by Baidu that has rich representations of language and semantic knowledge for understanding and generating natural language text.

[0166] 7) Llama 3: An open source pre-trained and fine-tuned large language model developed by Meta. It generates highly realistic and natural text by predicting the probability of the next word or sentence.

[0167] 8) Mixtral of Experts: A high-quality sparse mixture of experts model developed by Mistral AI. It has a high processing speed, can handle multiple languages, and generate complex and high-quality text.

[0168] The experimental results of SM-HK and the baseline model are shown in Table 2.

[0169] Table 2: Experimental results of baseline model and SM-HK on EDR2D (%)

[0170]

[0171] It can be observed that SM-HK achieves the best accuracy and macro-F1 values ​​of 87.34% and 74.98% on EDR2D. Therefore, this shows that the SM-HK proposed in the present invention can not only accurately predict the risk level of users in the early stage of depression, but also show better overall performance than other PLMs and LLMs. This also proves that by introducing and fully integrating important external knowledge such as emotional knowledge and depression domain knowledge, while considering the overall severity of the user's negative emotions, the model can further help accurately understand the user's current true mental state. In addition, the present invention also observed that LLMs are much lower than PLMs in overall performance. The present invention attributes this performance gap to the fact that LLMs have obtained rich world-wide knowledge through various training on a large amount of domain data and corpora, and can handle most tasks well. However, due to the scarcity of depression-related data and the complexity of the task, it is difficult for them to learn the depression domain knowledge and the characteristics of users with early depression. At the same time, due to the large amount of data posted by users, the input length limit of LLMs makes it impossible to analyze and understand all the posts of users. These reasons lead to the inability of LLMs to accurately predict the risk of users in the early stage of depression.

[0172] The present invention also analyzes the contribution of different modules to the overall performance of the emotion perception model SM-HK proposed in the present invention through ablation experiments.

[0173] In some embodiments, four ablation models are introduced, including SM-HK w / o SK, SM-HK w / o DK, SM-HKw / o HF, and SM-HK w / o UNSSD. SM-HK w / o SK does not adopt emotion-enhanced domain fine-tuning to acquire emotion knowledge. SM-HK w / o DK does not introduce relevant depression symptom knowledge. SM-HK w / o HF does not construct a post-symptom heterogeneous graph, and concatenates the contextual representation of the fused negative emotion knowledge and the semantic representation of the relevant depression symptom nodes as the final representation. SM-HK w / o UNSSD does not adopt UNSSD task joint training. The experimental results are shown in Table 3.

[0174] Table 3: Experimental results of SM-HK and its ablation model (%)

[0175]

[0176] In Table 3, first, it can be seen that SM-HK w / o DK has the worst overall performance. This shows that by reasonably introducing depression symptom knowledge at the user level, it can help the model understand the depression symptoms that users may show in their post expressions, thereby correctly predicting the risk level of users in the early stages of depression. Second, the overall performance of SM-HK w / o HF has dropped significantly. This shows that based on the topic relevance and time order between posts, the model can fully integrate emotional knowledge and depression symptom knowledge through the post-symptom heterogeneous graph, so that it can understand the user's true mental state. Third, the overall performance of SM-HK w / o SK has dropped significantly. This further verifies that by reasonably introducing negative emotional knowledge at the post level, the model can help the model capture the user's emotional changes, thereby deeply understanding the emotional tendency under implicit expression. Finally, the overall performance of SM-HK w / o UNSSD has dropped. This may be because although the model can understand the user's overall emotional tendency by fully integrating negative emotional knowledge, it cannot distinguish the severity of the user's negative emotions. This causes the model to incorrectly predict some users with mild negative emotions as medium or high risk.

[0177] Figure 3 This is an exemplary flow chart of a method for detecting early depression risk according to some embodiments of this specification. The method is based on the emotion perception model constructed above and specifically includes:

[0178] S301, obtaining a social media dynamic dataset of a target user;

[0179] S302, preprocessing the social media dynamic data set to obtain a post set of the target user containing at least one emotional content;

[0180] S303, inputting the post set into a trained emotion perception model to predict the early depression risk level of the target user, wherein the emotion perception model is composed of a post representation layer, a user representation layer and a detection layer.

[0181] The basic concepts have been described above. Obviously, for those skilled in the art, the above detailed disclosure is only for example and does not constitute a limitation of this specification. Although not explicitly stated here, those skilled in the art may make various modifications, improvements and corrections to this specification. Such modifications, improvements and corrections are suggested in this specification, so such modifications, improvements and corrections still belong to the spirit and scope of the exemplary embodiments of this specification.

[0182] At the same time, this specification uses specific words to describe the embodiments of this specification. For example, "one embodiment", "an embodiment", and / or "some embodiments" refer to a certain feature, structure or characteristic related to at least one embodiment of this specification. Therefore, it should be emphasized and noted that "one embodiment" or "an embodiment" or "an alternative embodiment" mentioned twice or more in different positions in this specification does not necessarily refer to the same embodiment. In addition, certain features, structures or characteristics in one or more embodiments of this specification can be appropriately combined.

[0183] In addition, unless explicitly stated in the claims, the order of the processing elements and sequences described in this specification, the use of alphanumeric characters, or the use of other names are not intended to limit the order of the processes and methods of this specification. Although the above disclosure discusses some invention embodiments that are currently considered useful through various examples, it should be understood that such details are only for illustrative purposes, and the attached claims are not limited to the disclosed embodiments. On the contrary, the claims are intended to cover all modifications and equivalent combinations that are consistent with the essence and scope of the embodiments of this specification. For example, although the system components described above can be implemented by hardware devices, they can also be implemented only by software solutions, such as installing the described system on an existing server or mobile device.

[0184] Similarly, it should be noted that in order to simplify the description disclosed in this specification and thus help understand one or more embodiments of the invention, in the above description of the embodiments of this specification, multiple features are sometimes combined into one embodiment, figure or description thereof. However, this disclosure method does not mean that the features required by the subject matter of this specification are more than the features mentioned in the claims. In fact, the features of the embodiments are less than all the features of the single embodiment disclosed above.

[0185] In some embodiments, numbers describing the number of components and attributes are used. It should be understood that such numbers used in the description of the embodiments are modified by the modifiers "about", "approximately" or "substantially" in some examples. Unless otherwise specified, "about", "approximately" or "substantially" indicate that the numbers are allowed to vary by ±20%. Accordingly, in some embodiments, the numerical parameters used in the specification and claims are approximate values, which may change according to the required features of individual embodiments. In some embodiments, the numerical parameters should take into account the specified significant digits and adopt the general method of retaining digits. Although the numerical domains and parameters used to confirm the breadth of their range in some embodiments of this specification are approximate values, in specific embodiments, the setting of such numerical values ​​is as accurate as possible within the feasible range.

[0186] Each patent, patent application, patent application publication, and other materials, such as articles, books, specifications, publications, documents, etc., cited in this specification are hereby incorporated by reference in their entirety. Except for application history documents that are inconsistent with or conflicting with the contents of this specification, documents that limit the broadest scope of the claims of this specification (currently or later attached to this specification) are also excluded. It should be noted that if the descriptions, definitions, and / or use of terms in the materials attached to this specification are inconsistent or conflicting with the contents described in this specification, the descriptions, definitions, and / or use of terms in this specification shall prevail.

[0187] Finally, it should be understood that the embodiments described in this specification are only used to illustrate the principles of the embodiments of this specification. Other variations may also fall within the scope of this specification. Therefore, as an example and not a limitation, alternative configurations of the embodiments of this specification may be considered consistent with the teachings of this specification. Accordingly, the embodiments of this specification are not limited to the embodiments explicitly introduced and described in this specification.

Claims

1. A method for constructing an emotion perception model, characterized in that: The emotion perception model consists of a post representation layer, a user representation layer and a detection layer, including: Constructing a data set, obtaining a social media dynamic data set of the user to be detected, performing preprocessing based on the social media dynamic data set, and obtaining a set of early depression description posts containing at least one content and an early depression risk label of the user to be detected; Constructing the post representation layer, constructing a domain corpus with negative sentiment knowledge based on the sentiment knowledge graph, and using a pre-trained language model to capture a context representation sequence that incorporates negative sentiment knowledge; The specific steps of constructing the post representation layer include: Generate negative emotion auxiliary sentences using the emotion knowledge graph and build a domain corpus with negative emotion knowledge; Determining the severity of negative emotion of each word based on the attribute value of each word in the domain corpus of negative emotion knowledge; Using the severity of the negative emotion of the vocabulary to construct negative emotion auxiliary sentences related to the vocabulary, further obtaining a domain corpus with negative emotion knowledge; Performing domain fine-tuning based on the domain corpus of the negative emotion knowledge to obtain a pre-trained model for emotion enhancement; Using the emotion-enhanced pre-trained model as an encoder, encoding the set of early depression description posts to obtain a context representation sequence that incorporates negative emotion knowledge; Constructing the user representation layer, constructing a user-level post-symptom heterogeneous graph in combination with depression symptom knowledge, and obtaining a user representation matrix integrating heterogeneous knowledge based on the output of the post representation layer; The specific steps of constructing the user representation layer include: Construct a semantic representation vector set of depression symptom nodes based on depression knowledge; Based on the semantic representation vector set of the depression symptom nodes, by calculating the semantic similarity corresponding to each post in the early description post set of depression, a depression symptom node set corresponding to each post is determined; Based on the depressive symptom node set and the contextual representation fused with negative emotion knowledge, a user-level post-symptom heterogeneous graph is constructed through a heterogeneous knowledge fusion method; Based on the post-symptom heterogeneous graph, a graph attention network is applied to aggregate adjacent nodes to obtain a heterogeneous representation of the set of posts describing early depression; The heterogeneous representation is input into a multi-layer perceptron after dimension reduction through a fully connected layer to obtain a user representation matrix integrating heterogeneous knowledge; Building the detection layer, which is composed of a Softmax function and a loss function, and predicting the early depression risk level of the user to be detected based on the user representation matrix input into the detection layer; The emotion perception model is obtained by training based on the loss function.

2. The method for constructing an emotion perception model according to claim 1, characterized in that: The social media dynamic data set of the user to be detected includes: user basic information, post set, and at least one data attribute of a posting timestamp.

3. The method for constructing an emotion perception model according to claim 2, characterized in that: The steps for preprocessing the social media dynamics dataset to obtain a set of early description posts of depression include: Based on a preset list of relevant keywords, automatically remove abnormal user data in the social media dynamic data set; Based on the publishing timestamp attribute of the posts, the posts in the social media dynamics dataset are rearranged to obtain a post set sequence based on time order; The first post containing key information in the post set is located as the final post, and the posts after the final post are removed to obtain a post set containing at least one content that describes early stages of depression.

4. The method for constructing an emotion perception model according to claim 2, characterized in that: The steps for preprocessing social media dynamic datasets to obtain early depression risk labels include: Sliding and intercepting the set of posts describing early depression based on a preset time period to obtain at least one analysis window; Obtain the weighted negative sentiment value of the post set in each analysis window based on the sentiment knowledge graph; Determine the comprehensive weight of each analysis window based on the number of posts in each analysis window and the time sequence of the posts; The weighted negative sentiment value of the post set in each analysis window is multiplied by the comprehensive weight and added together to obtain the early depression risk score value; An early depression risk signature is determined based on the obtained early depression risk score value.

5. The method for constructing an emotion perception model according to claim 1, characterized in that: The construction of the emotion perception model also includes: The social media dynamic data set is preprocessed to obtain a true label of the severity of the negative emotion of the user to be detected.

6. The method for constructing an emotion perception model according to claim 5, characterized in that: Also includes: The detection layer includes at least one Softmax function and at least one loss function; Inputting the user representation matrix into a first Softmax function to obtain the early depression risk level of the user to be detected; Inputting the early depression risk level and the early depression risk label into a first loss function to obtain a first loss value; Inputting the user representation matrix into a second Softmax function to obtain the overall negative emotion level of the user to be detected; Inputting the true label of the severity of the negative emotion and the overall negative emotion level into a second loss function to obtain a second loss value; The first loss value and the second loss value are superimposed to construct a complete loss function for model training to obtain the final emotion perception model.

7. A method for detecting early depression risk using the emotion perception model according to any one of claims 1 to 6, characterized in that: The following steps are involved: Obtain a social media dynamics dataset of target users; Preprocessing the social media dynamic data set to obtain a post set of the target user containing at least one emotional content; The post set is input into a trained emotion perception model to predict the early depression risk level of the target user, wherein the emotion perception model is composed of a post representation layer, a user representation layer and a detection layer.

Citation Information

Patent Citations

  • Depression detection method based on knowledge distillation and emotion integration model

    CN113111152A

  • Social media text depression tendency analysis-oriented feature weighting method based on sorting learning model

    CN113268582A