Psychological health assessment method and system based on personality disjunction
By constructing a comparative learning and mood swing module, combining the Transformer mechanism and the gated loop unit, decoupling and fusing semantic features, the deep information problem of social media users' mental health assessment in the existing technology is solved, and a more accurate and stable mental health assessment is achieved.
Patent Information
- Application Number
- CN202510678941.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2025-06-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art fails to fully tap deep text semantic information when evaluating the mental health status of social media users and fails to fully consider the impact of emotional fluctuations and personality traits on psychological state, resulting in inaccurate and unstable assessment.
Using a mental health assessment method based on personality dissection, we construct a comparative learning processing module, mood swing module and gated fusion module, combined with the Transformer mechanism and gated loop unit, decouple semantic stability features and semantic timeliness, fuse semantic features at different levels, and use Fourier transform and wavelet transform to extract emotional features to build an optimized mental health assessment model.
It improves the ability to model users' psychological state, comprehensively capture emotional change patterns, reduce information redundancy, and improves the generalization ability and evaluation accuracy of the model.
Smart Images

Figure CN120199501A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of natural language processing, and particularly to a mental health assessment method and system based on personality disjunction. Background Art
[0002] Mental health problems are an important concern in the global public health field. Every year, a large number of individuals are severely affected due to mental health distress. Research shows that persistent negative emotions are closely related to higher psychological risks. However, many individuals in psychological distress do not actively express their true thoughts to people around them or seek professional help at critical moments. In recent years, more and more individuals tend to share their mental states on social networks, and about 80% of them have revealed experiences of negative emotions or low mood on social media, which provides important clues for mental health risk assessment.
[0003] However, it is difficult to accurately judge an individual's mental state based on a single post, because the content of the user's post often involves multiple topics and is not limited to expressing low mood. The emotional state is very complex. Some researchers analyze the user's historical posting records to identify their online behavior patterns in order to improve the accuracy of mental state assessment. Some studies have tried to use sequence models such as LSTM for the detection of mental health states, but this method usually assumes that the time interval between posts is fixed. However, in actual situations, the posting time on social media is often irregular, and the change in the time interval may affect the assessment of the user's psychological change trend. In addition, the emotional fluctuations and changes in mental states may show complex patterns. Therefore, some researchers have proposed combining language models with historical environmental information, and a time perception and stage perception method based on emotion and semantics to more accurately identify the change trend of mental states.
[0004] Although these methods have been optimized in the time dimension, they still do not fully explore the deep information of text semantic features and have certain limitations. There are still many challenges in assessing mental health risks based on text semantics. On the one hand, the same semantic expression may have different true meanings in different contexts. On the other hand, the emotional fluctuations and personality characteristics of individuals have an undeniable impact on their mental states, but existing studies often do not fully consider these factors, making the model may not be able to accurately model the long-term emotional trends and personality states of individuals, thus affecting the stability of mental health assessment. Summary of the Invention
[0005] In view of the above situation, the main purpose of the present invention is to propose a mental health assessment method and system based on personality disjunction to solve the above technical problems.
[0006] The present invention proposes a mental health assessment method based on personality disjunction, and the method includes the following steps: Step 1: Construct a contrastive learning processing module based on the contrastive learning mechanism, construct an emotional fluctuation module based on the Fourier transform mechanism and the wavelet transform mechanism, and construct a gated fusion module based on the gating mechanism. The contrastive learning processing module, the emotional fluctuation module, and the gated fusion module constitute a mental health assessment model; Step 2: Obtain the posts published by the user, and perform feature encoding processing on the posts based on the pre-trained language model to obtain semantic feature vectors, emotional feature vectors, and personality feature vectors; Step 3: Process the semantic feature vectors, emotional feature vectors, and personality feature vectors based on the Transformer mechanism to obtain semantic stable features and semantic timeliness features respectively, and process the semantic stable features and semantic timeliness features based on the gated recurrent unit to obtain semantic deep features; Step 4: Use the contrastive learning processing module to decouple the semantic stable features and semantic timeliness features to construct four groups of contrastive learning tasks; Step 5: Use the emotional fluctuation module to comprehensively analyze the emotional features to obtain emotional fluctuation features; Step 6: Use the gated fusion module to fuse the semantic deep features and the emotional fluctuation features to obtain a prediction result, and optimize the mental health assessment model based on the prediction result and the four groups of contrastive learning tasks to obtain an optimized mental health assessment model; Input the posts published by the user into the optimized mental health assessment model to obtain a mental health assessment result.
[0007] The present invention also proposes a mental health assessment system based on personality disjunction. Among them, the system applies a mental health assessment method based on personality disjunction as described above. The system includes: A construction module for: Construct a contrastive learning processing module based on the contrastive learning mechanism, construct an emotional fluctuation module based on the Fourier transform mechanism and the wavelet transform mechanism, and construct a gated fusion module based on the gating mechanism. The contrastive learning processing module, the emotional fluctuation module, and the gated fusion module constitute a mental health assessment model; A pre-trained language model module for: Obtain the posts published by the user, and perform feature encoding processing on the posts based on the pre-trained language model to obtain semantic feature vectors, emotional feature vectors, and personality feature vectors; An adaptive fusion module for: Process the semantic feature vectors, emotional feature vectors, and personality feature vectors based on the Transformer mechanism to obtain semantic stable features and semantic timeliness features respectively, and process the semantic stable features and semantic timeliness features based on the gated recurrent unit to obtain semantic deep features; A contrastive learning module for: Using the contrastive learning processing module to decouple semantic stable features and semantic time-varying features to construct four sets of contrastive learning tasks; An emotional fluctuation feature module for: Using the emotional fluctuation module to comprehensively analyze emotional features to obtain emotional fluctuation features; A gated adaptive fusion module for: Using the gated fusion module to fuse semantic deep features and emotional fluctuation features to obtain a prediction result, and optimizing the mental health assessment model based on the prediction result and the four sets of contrastive learning tasks to obtain an optimized mental health assessment model; Inputting the post published by the user into the optimized mental health assessment model to obtain a mental health assessment result.
[0008] Compared with the prior art, the beneficial effects of the present invention are: 1. The present invention constructs an adaptive fusion module based on the context representation of the gated recurrent unit to fuse semantic time-varying features and semantic stable features at different levels, obtains the semantic deep feature representation of the user, can adaptively adjust the feature fusion method according to the context information, gives full play to the complementary advantages of both, and improves the modeling ability of the user's mental state; 2. The present invention constructs an emotional fluctuation module, uses Fourier transform and wavelet transform to extract the frequency domain features and local time-frequency features of the user's emotions respectively, and splices them, can comprehensively capture the change patterns of the user's emotions, solves the problem that it is difficult for the existing methods to effectively model complex emotional fluctuations, and improves the assessment ability of emotional trends; 3. The present invention constructs a contrastive learning processing module, uses emotions and personalities to construct proxy features, thus avoiding the problem that there is no explicit supervision label to guide the model to decouple. By decoupling semantic time-varying features and semantic stable features, information redundancy is reduced, and the generalization ability of the model is improved.
[0009] The additional aspects and advantages of the present invention will be partly given in the following description, partly will become obvious from the following description, or will be understood through the embodiments of the present invention. Description of the Drawings
[0010] Figure 1 It is a step flow chart of the mental health assessment method based on personality disjunction proposed by the present invention; Figure 2 It is a method architecture diagram of the mental health assessment method based on personality disjunction proposed by the present invention; Figure 3 It is a system structure diagram of the mental health assessment system based on personality disjunction proposed by the present invention. Detailed Embodiments
[0011] Embodiments of the present invention will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by reference to the accompanying drawings are exemplary only for explaining the present invention and should not be construed as limiting the present invention.
[0012] These and other aspects of the embodiments of the present invention will become clear with reference to the following description and drawings. In these descriptions and drawings, some specific embodiments of the embodiments of the present invention are specifically disclosed to represent some ways of implementing the principles of the embodiments of the present invention. However, it should be understood that the scope of the embodiments of the present invention is not limited thereto.
[0013] Please refer to Figure 1 , this embodiment provides a mental health assessment method based on personality disjunction. The method includes the following steps: Step 1: Construct a contrast learning processing module based on the contrast learning mechanism, construct an emotional fluctuation module based on the Fourier transform mechanism and the wavelet transform mechanism, and construct a gated fusion module based on the gated mechanism. The contrast learning processing module, the emotional fluctuation module, and the gated fusion module constitute a mental health assessment model.
[0014] Step 2: Obtain the posts published by the user, and perform feature encoding processing on the posts published by the user based on the pre-trained language model to obtain a semantic feature vector, an emotional feature vector, and a personality feature vector.
[0015] Please refer to Figure 2 , in Step 2, obtaining the posts published by the user and performing feature encoding processing on the posts based on the pre-trained language model to obtain a semantic feature vector, an emotional feature vector, and a personality feature vector specifically includes the following sub-steps: Input the posts published by the user into the SentenceBERT model for feature extraction to obtain a semantic feature vector. There is the following relational expression in the corresponding process: ; Where represents the semantic feature vector of the th post, represents after feature extraction by the SentenceBERT model, represents the th post, represents the index of the post; Input the posts published by the user into the PlutchikBERT model for feature extraction to obtain an emotional feature vector. There is the following relational expression in the corresponding process: ; Where Indicates the emotional feature vector of the th post, indicating that it is after feature extraction by the PlutchikBERT model; The post published by the user is input into the PersonalityBERT model for feature extraction to obtain the personality feature vector. There is the following relational expression in the corresponding process: ; Among them, Indicates the th post's personality feature vector, indicating that it is after feature extraction by the PersonalityBERT model.
[0016] It should be noted that in the appendix Figure 2 in, represents the posting time of the post, all represent emotional feature vectors, all represent semantic feature vectors, all represent personality feature vectors.
[0017] Step 3: Process the semantic feature vector, emotional feature vector, and personality feature vector based on the Transformer mechanism to respectively obtain the semantic stable feature and semantic timeliness feature, and process the semantic stable feature and semantic timeliness feature based on the gated recurrent unit to obtain the semantic deep feature.
[0018] In Step 3, the semantic feature vector, emotional feature vector, and personality feature vector are processed based on the Transformer mechanism to respectively obtain the semantic stable feature and semantic timeliness feature, and the semantic stable feature and semantic timeliness feature are processed based on the gated recurrent unit to obtain the semantic deep feature, which specifically includes the following sub-steps: Calculate the decay weight based on the user's posting time interval to obtain the time decay weight, and fuse the time decay weight with the Transformer to obtain the Time-Transformer with a time decay mechanism. There is the following relational expression in the corresponding process: ; Among them, Indicates the th post's posting time interval from the last post, Indicates the th post's posting time, Indicates the last post's posting time, Indicates the total number of posts, Indicates the th post's time decay weight, represents the learnable multi-head attenuation coefficient; Process the semantic feature vector based on the Time-Transformer mechanism to obtain the attenuated semantic feature vector, process the emotion feature vector based on the aggregation of the Time-Transformer mechanism and the attention mechanism to obtain the attenuated emotion feature representation; perform a difference analysis on the attenuated semantic feature vector and the attenuated emotion feature representation to obtain the semantic timeliness feature weight; perform a normalization process on the semantic timeliness feature weight to obtain the normalized semantic timeliness feature weight; perform a weighted sum on the attenuated semantic feature vector based on the normalized semantic timeliness feature weight to obtain the semantic timeliness feature. The following relational expressions exist in the corresponding process: ; where, represents the semantic timeliness feature weight of the th post, represents the non-linear transformation operation, represents the semantic feature vector of the th post after being processed by the Time-Transformer mechanism, represents the emotion feature representation after the aggregation of the Time-Transformer mechanism and the attention mechanism, represents the vector concatenation operation, represents the normalized semantic timeliness feature weight of the th post, represents the semantic timeliness feature; Process the semantic feature vector based on the Transformer mechanism to obtain the processed semantic feature vector, process the personality feature vector based on the aggregation of the Transformer mechanism and the attention mechanism to obtain the processed personality feature representation; perform a difference analysis on the processed semantic feature vector and the processed personality feature representation to obtain the semantic stability feature weight; perform a normalization process on the semantic stability feature weight to obtain the normalized semantic stability feature weight, and perform a weighted sum on the processed semantic feature vector based on the normalized semantic stability feature weight to obtain the semantic stability feature. The following relational expressions exist in the corresponding process: ; where, represents the semantic stability feature weight of the th post, represents the semantic feature vector of the th post after being processed by the Transformer mechanism, represents the personality feature representation after the aggregation of the Transformer mechanism and the attention mechanism, Denote the semantic stability feature weight of the n-th post after normalization, which represents the semantic stability feature; Encode the semantic feature sequence based on the gated recurrent unit to obtain the context hidden representation. Connect the context hidden representation, semantic timeliness feature, and semantic stability feature, and successively process them through a multi-layer perceptron network and a Sigmoid function to obtain the fusion weight. The following relational expressions exist in the corresponding process: ; where, represents the context hidden representation, represents the processing by the gated recurrent unit, represents the fusion weight, represents the processing by the Sigmoid function, represents the processing by the multi-layer perceptron network; Perform adaptive fusion on the semantic timeliness feature and semantic stability feature based on the fusion weight to obtain the semantic deep feature. The following relational expressions exist in the corresponding process: ; where, represents the semantic deep feature, represents the processing by standard deviation normalization.
[0019] Step 4: Use the contrastive learning processing module to decouple the semantic stability feature and semantic timeliness feature to construct four groups of contrastive learning tasks.
[0020] In Step 4, use the contrastive learning processing module to decouple the semantic stability feature and semantic timeliness feature to construct four groups of contrastive learning tasks, which specifically include the following sub-steps: Calculate the mean of the personality feature vectors corresponding to all the posts published by the user to obtain the personality proxy feature. Calculate the mean of the emotion feature vectors corresponding to the user's most recent n posts to obtain the emotion proxy feature. The following relational expressions exist in the corresponding process: ; where, represents the personality proxy feature, represents the emotion proxy feature, represents the window size of the most recent posts; Design contrastive learning tasks based on the personality proxy feature, emotion proxy feature, semantic stability feature, and semantic timeliness feature to construct four groups of contrastive learning tasks. The following relational expressions exist in the corresponding process: ; Among them, represents the Euclidean distance.
[0021] It should be noted that the first group of learning tasks encourages the Euclidean distance between the semantic stability features and the personality agent features to be smaller than the Euclidean distance between the semantic stability features and the emotional agent features. The second group of learning tasks encourages the Euclidean distance between the semantic stability features and the personality agent features to be smaller than the distance between the semantic timeliness features and the personality agent features. The third group of learning tasks encourages the Euclidean distance between the semantic timeliness features and the emotional agent features to be smaller than the Euclidean distance between the semantic timeliness features and the personality agent features. The fourth group of learning tasks encourages the Euclidean distance between the semantic timeliness features and the emotional agent features to be smaller than the Euclidean distance between the semantic stability features and the emotional agent features.
[0022] Step 5: Use the emotion fluctuation module to comprehensively analyze the emotion features to obtain emotion fluctuation features.
[0023] In step 5, using the emotion fluctuation module to comprehensively analyze the emotion features to obtain emotion fluctuation features, specifically including the following sub-steps: Perform Fourier transform processing on the emotion feature representation to obtain Fourier transform features. The following relational expressions exist in the corresponding process: ; Among them, represents the discrete Fourier transform result of the th frequency component, represents the total number of sampling points, represents the discrete Fourier transform result of the th frequency component in the frequency domain, represents the index of the frequency component, represents the emotion feature representation, represents the th sampling point of the emotion feature representation, represents the index of the sampling point, represents the complex exponential function, represents the sum of the squares of the real parts, represents the sum of the squares of the imaginary parts, represents the amplitude of the th frequency component, represents the angular frequency of the th frequency component, represents the signal length, represents the imaginary unit, represents the Fourier transform feature, all represent the amplitude of the frequency component; Perform wavelet transform processing on the emotional feature representation to obtain approximation coefficients and detail coefficients. The following relational expressions exist in the corresponding process: ; Among them, represents the th approximation coefficient in the th decomposition layer, represents the th detail coefficient in the th decomposition layer, represents the coefficient of the low-pass filter, represents the coefficient of the high-pass filter, represents the position index, represents the number of decomposition layers, represents the index of the output sequence; Perform normalization processing on the approximation coefficients and detail coefficients respectively to obtain the normalized approximation coefficients and the normalized detail coefficients. Concatenate the normalized approximation coefficients and the normalized detail coefficients to obtain the wavelet transform feature. The following relational expressions exist in the corresponding process: ; Among them, represents the wavelet transform feature, represents the normalized approximation coefficient, represents the normalized detail coefficient; Concatenate the Fourier transform feature and the wavelet transform feature, and perform standard deviation normalization processing to obtain the emotional fluctuation feature. The following relational expressions exist in the corresponding process: ; Among them, represents the emotional fluctuation feature.
[0024] Step 6: Use the gated fusion module to fuse the semantic deep feature and the emotional fluctuation feature to obtain a prediction result. Optimize the mental health assessment model based on the prediction result and four groups of contrastive learning tasks to obtain an optimized mental health assessment model; Input the post published by the user into the optimized mental health assessment model to obtain the mental health assessment result.
[0025] In the said Step 6, use the gated fusion module to fuse the semantic deep feature and the emotional fluctuation feature to obtain a prediction result. Optimize the mental health assessment model based on the prediction result and four groups of contrastive learning tasks to obtain an optimized mental health assessment model. Input the post published by the user into the optimized mental health assessment model to obtain the mental health assessment result, which specifically includes the following sub-steps: The semantic deep features and emotional fluctuation features are processed respectively based on the gating mechanism, and the semantic deep features weighted by the gating mechanism and the emotional fluctuation features weighted by the gating mechanism are obtained respectively. The following relational expressions exist in the corresponding process: ; Among them, represents the semantic deep features weighted by the gating mechanism, represents element-wise multiplication, represents the trainable weight matrix for the semantic deep features, represents the bias term for the semantic deep features, represents the emotional fluctuation features weighted by the gating mechanism, represents the trainable weight matrix for the emotional fluctuation features, represents the bias term for the emotional fluctuation features; The semantic deep features weighted by the gating mechanism and the emotional fluctuation features weighted by the gating mechanism are concatenated to obtain the final feature representation. The final feature representation is input into a multi-layer perceptron for classification processing to obtain the prediction result. The following relational expressions exist in the corresponding process: ; Among them, represents the final feature representation, represents the th prediction result of the user, represents the index of the user, represents being processed by the multi-layer perceptron, represents the trainable weight matrix for the final feature representation, represents the bias term for the final feature representation; Based on the prediction result, a cross-entropy loss is constructed. The following relational expressions exist in the corresponding process: ; Among them, represents the cross-entropy loss, represents the th true label of the user, represents the total number of users in the dataset, represents taking the logarithm; Based on four contrastive learning tasks, triplet losses are constructed respectively. The total contrastive loss is obtained by calculating the mean based on the triplet losses. The following relational expressions exist in the corresponding process: ; Among them, represents the triplet loss, represents the positive margin, represents the total contrastive loss; Optimize the mental health assessment model using cross - entropy loss and total contrast loss to obtain an optimized mental health assessment model; Input the posts published by users into the optimized mental health assessment model to obtain mental health assessment results.
[0026] Furthermore, the total training loss is: ; where, represents the total training loss, represents the hyperparameter, represents the regularization coefficient, represents the square of the L2 norm of the model parameters.
[0027] Please refer to Figure 3 , this embodiment also provides a mental health assessment system based on personality disjunction. Among them, the system applies the mental health assessment method based on personality disjunction as described above. The system includes: A construction module, used for: Construct a contrast learning module based on the contrast learning mechanism, construct an emotional fluctuation module based on the Fourier transform mechanism and the wavelet transform mechanism, construct a gated adaptive fusion module based on the gated mechanism. The contrast learning module, the emotional fluctuation module and the gated adaptive fusion module constitute the mental health assessment model; A pre - trained language model module, used for: Obtain the posts published by users, and perform feature encoding processing on the posts based on the pre - trained language model to obtain semantic feature vectors, emotional feature vectors and personality feature vectors; An adaptive fusion module, used for: Process the semantic feature vectors, emotional feature vectors and personality feature vectors based on the Transformer mechanism to obtain semantic stable features and semantic time - efficient features respectively, and process the semantic stable features and semantic time - efficient features based on the gated recurrent unit to obtain semantic deep features; A contrast learning module, used for: Use the contrast learning processing module to decouple the semantic stable features and semantic time - efficient features to construct four groups of contrast learning tasks; An emotional fluctuation feature module, used for: Use the emotional fluctuation module to comprehensively analyze the emotional features to obtain emotional fluctuation features; A gated adaptive fusion module, used for: Use the gated fusion module to fuse the semantic deep features and the emotional fluctuation features to obtain a prediction result, and optimize the mental health assessment model based on the prediction result and the four groups of contrast learning tasks to obtain an optimized mental health assessment model; Input the post published by the user into the optimized mental health assessment model to obtain the mental health assessment result.
[0028] It should be understood that although the steps in the flowcharts of the embodiments of the present invention are shown in sequence according to the indications of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in each embodiment may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same moment, but can be executed at different moments. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.
[0029] In the description of this specification, the descriptions referring to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.
[0030] The above-described embodiments merely represent several implementation manners of the present invention, and their descriptions are relatively specific and detailed, but should not be construed as a limitation to the scope of the patent of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can still be made, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention should be subject to the appended claims.
Claims
1. A mental health assessment method based on personality disjunction, characterized in that, The method includes the following steps: Step 1: Construct a contrast learning processing module based on the contrast learning mechanism, construct an emotional fluctuation module based on the Fourier transform mechanism and the wavelet transform mechanism, construct a gated fusion module based on the gated mechanism. The contrast learning processing module, the emotional fluctuation module and the gated fusion module constitute a mental health assessment model; Step 2: Obtain the posts published by the user, and perform feature encoding processing on the posts published by the user based on the pre-trained language model to obtain semantic feature vectors, emotional feature vectors and personality feature vectors; Step 3: Process the semantic feature vectors, emotional feature vectors and personality feature vectors based on the Transformer mechanism to obtain semantic stable features and semantic timeliness features respectively. Process the semantic stable features and semantic timeliness features based on the gated recurrent unit to obtain semantic deep features; Step 4: Use the contrast learning processing module to decouple the semantic stable features and semantic timeliness features to construct four groups of contrast learning tasks; Step 5: Use the emotional fluctuation module to comprehensively analyze the emotional features to obtain emotional fluctuation features; Step 6: Use the gated fusion module to fuse the semantic deep features and the emotional fluctuation features to obtain a prediction result. Optimize the mental health assessment model based on the prediction result and the four groups of contrast learning tasks to obtain an optimized mental health assessment model; Input the posts published by the user into the optimized mental health assessment model to obtain a mental health assessment result.
2. The mental health assessment method based on personality disjunction according to claim 1, wherein In the said Step 2, when obtaining the posts published by the user and performing feature encoding processing on the posts published by the user based on the pre-trained language model module to obtain semantic feature vectors, emotional feature vectors and personality feature vectors, it specifically includes the following sub-steps: Input the posts published by the user into the SentenceBERT model for feature extraction to obtain semantic feature vectors. There is the following relational expression in the corresponding process: ; in, Indicates The semantic feature vector of the post, It means that after the SentenceBERT model feature extraction, Indicates Posts, Represents the index of the post; Input the posts published by the user into the PlutchikBERT model for feature extraction to obtain emotional feature vectors. There is the following relational expression in the corresponding process: ; Among them, represents the emotional feature vector of the th post, indicating feature extraction by the PlutchikBERT model; Input the posts published by the user into the PersonalityBERT model for feature extraction to obtain personality feature vectors. There is the following relational expression in the corresponding process: ; Among them, represents the personality feature vector of the th post, indicating that the feature extraction is performed by the PersonalityBERT model.
3. The mental health assessment method based on personality disjunction according to claim 2, wherein In the said Step 3, when processing the semantic feature vectors, emotional feature vectors and personality feature vectors based on the Transformer mechanism to obtain semantic stable features and semantic timeliness features respectively, and processing the semantic stable features and semantic timeliness features based on the gated recurrent unit to obtain semantic deep features, it specifically includes the following sub-steps: Calculate the decay weight based on the time interval between user posts to obtain the time decay weight, and fuse the time decay weight with the Transformer to obtain a Time-Transformer with a time decay mechanism; Process the semantic feature vector based on the Time-Transformer mechanism to obtain the decayed semantic feature vector. Process the emotion feature vector based on the aggregation of the Time-Transformer mechanism and the attention mechanism to obtain the decayed emotion feature representation. Perform a difference analysis on the decayed semantic feature vector and the decayed emotion feature representation to obtain the semantic timeliness feature weight. Perform a normalization process on the semantic timeliness feature weight to obtain the normalized semantic timeliness feature weight. Perform a weighted sum on the decayed semantic feature vector based on the normalized semantic timeliness feature weight to obtain the semantic timeliness feature. Process the semantic feature vector based on the Transformer mechanism to obtain the processed semantic feature vector. Process the personality feature vector based on the aggregation of the Transformer mechanism and the attention mechanism to obtain the processed personality feature representation. Perform a difference analysis on the processed semantic feature vector and the processed personality feature representation to obtain the semantic stability feature weight. Perform a normalization process on the semantic stability feature weight to obtain the normalized semantic stability feature weight. Perform a weighted sum on the processed semantic feature vector based on the normalized semantic stability feature weight to obtain the semantic stability feature. Encode the semantic feature sequence based on the gated recurrent unit to obtain the context hidden representation. Connect the context hidden representation, the semantic timeliness feature, and the semantic stability feature, and successively process them through a multi-layer perceptron network and a Sigmoid function to obtain the fusion weight. Perform an adaptive fusion on the semantic timeliness feature and the semantic stability feature based on the fusion weight, and perform a standard deviation normalization process to obtain the semantic deep feature.
4. The mental health assessment method based on personality disjunction according to claim 3, wherein Calculate the decay weight based on the user's posting time interval to obtain the time decay weight. Fuse the time decay weight with the Transformer to obtain the Time-Transformer with a time decay mechanism. The following relational expression exists in the corresponding process: ; Among them, represents the time interval between the th post and the last post, represents the posting time of the th post, represents the posting time of the last post, represents the total number of posts, represents the time decay weight of the th post, represents the learnable multi-head decay coefficient; In the step of processing the semantic feature vector based on the Time-Transformer mechanism to obtain the decayed semantic feature vector, processing the emotion feature vector based on the aggregation of the Time-Transformer mechanism and the attention mechanism to obtain the decayed emotion feature representation, performing a difference analysis on the decayed semantic feature vector and the decayed emotion feature representation to obtain the semantic timeliness feature weight, performing a normalization process on the semantic timeliness feature weight to obtain the normalized semantic timeliness feature weight, and performing a weighted sum on the decayed semantic feature vector based on the normalized semantic timeliness feature weight to obtain the semantic timeliness feature, the following relational expression exists in the corresponding process: ; Among them, represents the semantic timeliness feature weight of the th post, represents a non-linear transformation operation, represents the semantic feature vector of the th post after being processed by the Time-Transformer mechanism, represents the emotional feature representation after aggregating the Time-Transformer mechanism and the attention mechanism, represents a vector concatenation operation, represents the normalized semantic timeliness feature weight of the th post, represents the semantic timeliness feature; When processing the semantic feature vector based on the Transformer mechanism to obtain the processed semantic feature vector, processing the personality feature vector based on the aggregation of the Transformer mechanism and the attention mechanism to obtain the processed personality feature representation; performing a difference analysis on the processed semantic feature vector and the processed personality feature representation to obtain the semantic stability feature weight, performing a normalization process on the semantic stability feature weight to obtain the normalized semantic stability feature weight, and performing a weighted summation on the processed semantic feature vector based on the normalized semantic stability feature weight to obtain the semantic stability feature, the following relational expressions exist in the corresponding process: ; Among them, represents the semantic stability feature weight of the th post, represents the semantic feature vector of the th post after being processed by the Transformer mechanism, represents the personality feature representation after aggregating the Transformer mechanism and the attention mechanism, represents the normalized semantic stability feature weight of the th post, represents the semantic stability feature; When encoding and processing the semantic feature sequence based on the gated recurrent unit to obtain the context hidden representation, concatenating the context hidden representation, the semantic timeliness feature, and the semantic stability feature, and successively passing through the multi-layer perceptron network processing and the Sigmoid function processing to obtain the fusion weight, the following relational expressions exist in the corresponding process: ; Among them, represents the context hidden representation, represents being processed by a gated recurrent unit, both represent semantic feature vectors, represents the fusion weight, represents being processed by a Sigmoid function, represents being processed by a multi-layer perceptron network; When adaptively fusing the semantic timeliness feature and the semantic stability feature based on the fusion weight and performing a standard deviation normalization process to obtain the semantic deep feature, the following relational expressions exist in the corresponding process: ; Among them, represents the deep semantic feature, indicating that it has been processed by standard deviation normalization.
5. The mental health assessment method based on personality disjunction according to claim 4, wherein In step 4, the contrast learning processing module is used to decouple the semantic stability feature and the semantic timeliness feature to construct four groups of contrast learning tasks, which specifically include the following sub-steps: Calculate the mean value of the personality feature vectors corresponding to all posts published by the user to obtain the personality proxy feature. For the emotion feature vectors corresponding to the user's most recent posts, calculate the mean value to obtain the emotion proxy feature. There is the following relational expression in the corresponding process: ; Among them, represents the personality agent feature, represents the emotion agent feature, represents the window size of the most recent post; Based on the personality proxy feature, the emotion proxy feature, the semantic stability feature, and the semantic timeliness feature, the contrast learning task design is carried out to construct four groups of contrast learning tasks, and the following relational expressions exist in the corresponding process: ; Among them, represents the Euclidean distance.
6. The mental health assessment method based on personality disjunction according to claim 5, wherein In step 5, the emotion fluctuation module is used to comprehensively analyze the emotion feature to obtain the emotion fluctuation feature, which specifically includes the following sub-steps: Performing a Fourier transform process on the emotion feature representation to obtain the Fourier transform feature; Performing a wavelet transform process on the emotion feature representation to obtain the approximation coefficient and the detail coefficient; Performing a normalization process on the approximation coefficient and the detail coefficient respectively to obtain the normalized approximation coefficient and the normalized detail coefficient, and concatenating the normalized approximation coefficient and the normalized detail coefficient to obtain the wavelet transform feature; Concatenating the Fourier transform feature and the wavelet transform feature and performing a standard deviation normalization process to obtain the emotion fluctuation feature.
7. The mental health assessment method based on personality disjunction according to claim 6, wherein Performing a Fourier transform process on the emotion feature representation to obtain the Fourier transform feature, and the following relational expressions exist in the corresponding process: ; Among them, represents the discrete Fourier transform result of the th frequency component, represents the total number of sampling points, represents the discrete Fourier transform result of the th frequency component in the frequency domain, represents the index of the frequency component, represents the emotional feature representation, represents the th sampling point of the emotional feature representation, represents the index of the sampling point, represents the complex exponential function, represents the sum of the squares of the real parts, represents the sum of the squares of the imaginary parts, represents the th amplitude of the frequency component, represents the th angular frequency of the frequency component, represents the signal length, represents the imaginary unit, represents the Fourier transform feature, all represent the amplitude of the frequency component; In the step of performing a wavelet transform process on the emotion feature representation to obtain the approximation coefficient and the detail coefficient, the following relational expressions exist in the corresponding process: ; Among them, represents the -th approximation coefficient in the -th decomposition level, represents the -th detail coefficient in the -th decomposition level, represents the coefficient of the low-pass filter, represents the coefficient of the high-pass filter, represents the position index, represents the number of decomposition levels, represents the index of the output sequence; In the step of performing a normalization process on the approximation coefficient and the detail coefficient respectively to obtain the normalized approximation coefficient and the normalized detail coefficient, and concatenating the normalized approximation coefficient and the normalized detail coefficient to obtain the wavelet transform feature, the following relational expressions exist in the corresponding process: ; Among them, represents the wavelet transform feature, represents the normalized approximation coefficient, represents the normalized detail coefficient; In the step of concatenating the Fourier transform feature and the wavelet transform feature and performing a standard deviation normalization process to obtain the emotion fluctuation feature, the following relational expressions exist in the corresponding process: ; Among them, represents the emotional fluctuation characteristics.
8. The mental health assessment method based on personality disjunction according to claim 7, wherein In step 6, a gating fusion module is used to fuse the semantic deep features and the emotional fluctuation features to obtain a prediction result. Based on the prediction result and four groups of contrastive learning tasks, the mental health assessment model is optimized to obtain an optimized mental health assessment model, which specifically includes the following sub-steps: Based on the gating mechanism, the semantic deep features and the emotional fluctuation features are processed respectively to obtain the semantic deep features weighted by the gating mechanism and the emotional fluctuation features weighted by the gating mechanism; The semantic deep features weighted by the gating mechanism and the emotional fluctuation features weighted by the gating mechanism are concatenated to obtain the final feature representation, and the final feature representation is input into a multi-layer perceptron for classification processing to obtain a prediction result; Based on the prediction result, a cross-entropy loss is constructed; Based on four groups of contrastive learning tasks, triplet losses are constructed respectively, and the total contrastive loss is obtained by calculating the mean value based on the triplet losses; The mental health assessment model is optimized by using the cross-entropy loss and the total contrastive loss to obtain an optimized mental health assessment model.
9. The mental health assessment method based on personality disjunction according to claim 8, characterized in that, Based on the gating mechanism, the semantic deep features and the emotional fluctuation features are processed respectively to obtain the semantic deep features weighted by the gating mechanism and the emotional fluctuation features weighted by the gating mechanism. In the corresponding process, the following relational expressions exist: ; Among them, represents the deep semantic features weighted by the gating mechanism, represents element-wise multiplication, represents the trainable weight matrix for the deep semantic features, represents the bias term for the deep semantic features, represents the emotional fluctuation features weighted by the gating mechanism, represents the trainable weight matrix for the emotional fluctuation features, represents the bias term for the emotional fluctuation features; In the step of concatenating the semantic deep features weighted by the gating mechanism and the emotional fluctuation features weighted by the gating mechanism to obtain the final feature representation, and inputting the final feature representation into a multi-layer perceptron for classification processing to obtain a prediction result, the following relational expressions exist in the corresponding process: ; Among them, represents the final feature representation, represents the prediction result of the -th user, represents the index of the user, represents being processed by a multi-layer perceptron, represents the trainable weight matrix for the final feature representation, represents the bias term for the final feature representation; In the step of constructing a cross-entropy loss based on the prediction result, the following relational expressions exist in the corresponding process: ; Among them, represents the cross-entropy loss, represents the true label of the th user, represents the logarithmic operation; In the step of constructing triplet losses respectively based on four groups of contrastive learning tasks and calculating the mean value based on the triplet losses to obtain the total contrastive loss, the following relational expressions exist in the corresponding process: ; Among them, represents the triplet loss, represents the positive margin, represents the total contrastive loss.
10. A mental health assessment system based on personality disjunction, characterized in that, The system applies the mental health assessment method based on personality disjunction according to any one of claims 1 to 9. The system includes: A construction module, which is used for: Constructing a contrastive learning processing module based on the contrastive learning mechanism, constructing an emotional fluctuation module based on the Fourier transform mechanism and the wavelet transform mechanism, and constructing a gating fusion module based on the gating mechanism. The contrastive learning processing module, the emotional fluctuation module and the gating fusion module constitute the mental health assessment model; A pre-trained language model module, which is used for: Obtaining the posts published by the user, and performing feature encoding processing on the posts based on the pre-trained language model to obtain a semantic feature vector, an emotional feature vector and a personality feature vector; An adaptive fusion module, which is used for: Processing the semantic feature vector, the emotional feature vector and the personality feature vector based on the Transformer mechanism to respectively obtain semantic stable features and semantic time-effective features, and processing the semantic stable features and the semantic time-effective features based on the gated recurrent unit to obtain semantic deep features; A contrastive learning module, which is used for: Using the contrastive learning processing module to decouple the semantic stable features and the semantic time-effective features to construct four groups of contrastive learning tasks; An emotional fluctuation feature module, which is used for: The emotional fluctuation feature module is used to comprehensively analyze emotional features to obtain emotional fluctuation features; A gated adaptive fusion module, which is used for: The gated fusion module is used to fuse semantic deep features and emotional fluctuation features to obtain a prediction result, and the mental health assessment model is optimized based on the prediction result and four groups of contrastive learning tasks to obtain an optimized mental health assessment model; The posts published by the user are input into the optimized mental health assessment model to obtain a mental health assessment result.
Citation Information
Cited By
Text processing method and system based on multi-source feature regulation and fusion
CN121093972A