Personality detection method based on residual weighted dynamic graph convolutional network
Through the method based on residual weighted dynamic graph convolution network, the dynamic graph structure is constructed using the pre-trained language model BERT and residual weighting mechanism, which solves the problem of limited accuracy of personality detection and achieves more accurate personality detection.
Patent Information
- Application Number
- CN202510462613.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2025-03-31
- Filing Date
- 2025-04-14
- Publication Date
- 2025-08-26
AI Technical Summary
The accuracy of existing personality detection technologies is limited, and traditional graph neural networks have limitations in capturing deep personality traits.
Using a method based on residual weighted dynamic graph convolution network (R-DGCN), text features are extracted through pre-training language model BERT, dynamic graph structure is constructed, and residual weighting mechanism is introduced to enhance information aggregation ability. Cross-entropy loss function is used for training to generate accurate user personality representations.
It significantly improves the accuracy of personality detection, enhances the learning ability of stable personality traits, reduces noise interference, alleviates data imbalance problem, and improves the robustness of the model.
Smart Images

Figure CN120541199A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of personalized recommendation technology and relates to a personality detection method based on a residual weighted dynamic graph convolutional network (R-DGCN). Background Art
[0002] When analyzing individuals for specific purposes, personality traits have been found to be a very important characteristic. Over the past few decades, personality traits have been shown to be closely related to users' social media behavior. With the development of the Internet, internet users have increasingly used social media, generating a large source of new user-generated ecological data.
[0003] In recent years, the widespread use of large-scale pre-trained language models has brought new development opportunities to the field of personality detection. Furthermore, given the often nonlinear and highly correlated nature of user-generated content, graph neural networks (GNNs) have garnered widespread attention due to their advantages in processing such complex data structures. Against this backdrop, researchers have begun exploring the integration of diverse graph structure construction methods into personality detection models, a research direction that has become a significant trend in the field. However, existing research demonstrates that traditional GNNs still have limitations in capturing deep personality traits, prompting researchers to pursue deeper integration of personality detection tasks and graph learning methods. Summary of the Invention
[0004] This paper aims to address the limited accuracy of existing personality detection technologies by proposing a personality detection method based on a residual-weighted dynamic graph convolutional network (R-DGCN). This method is implemented through the following technical solutions: First, a pre-trained language model, BERT (Bidirectional Encoder Representation from Transformers), is used to extract deep semantic features from text content posted by users on social media platforms. Second, a dynamic graph structure based on user interaction relationships is constructed, and a residual weighting mechanism is used to enhance the information aggregation capabilities of the graph convolutional network. Finally, a precise user personality representation is generated through multi-level feature fusion, significantly improving the accuracy of personality detection.
[0005] The technical solutions adopted in the present invention are as follows:
[0006] Collect user posts on social media and preprocess each post to obtain the text feature vector of the post;
[0007] Construct user nodes, use the text feature vectors of posts as post nodes, and the user's posts on social media as directed edges to build a directed relationship graph of users;
[0008] The residual weighted dynamic graph convolutional network (R-DGCN) is used to dynamically learn the directed relationship graph to obtain the user representation vector; the user representation vector is converted into a personality category vector corresponding to the dimension of personality characteristics; and the user's personality category is predicted based on the personality category vector.
[0009] As a preference, in the process of training the residual weighted dynamic graph convolutional network R-DGCN, the cross entropy loss function is used as the loss function of gradient descent for back propagation, and a weighting mechanism is introduced, specifically:
[0010]
[0011] where ω i,c represents the weighted value of the cth category in the i-th classification task, c represents the number of categories of personality traits, y i,c represents the true label of sample i in category c.
[0012] Another object of the present invention is to provide a personality detection system for implementing the above method, comprising:
[0013] Data acquisition module, used to collect users' posts on social media;
[0014] Text feature extraction module, used to obtain the text feature vector of the post;
[0015] The personality detection module is used to construct a directed relationship graph based on the text feature vector of the post, use R-DGCN to further aggregate information, and reduce the dimension to obtain the personality category vector, and then predict the user's personality category.
[0016] Another object of the present invention is to provide a computer storage medium having a corresponding computing program stored thereon, which is used to execute the above method when the computing program is run in a computer.
[0017] Yet another object of the present invention is to provide a computing device comprising a memory and a processor, wherein the memory stores executable code, and the processor implements the above method when executing the executable code.
[0018] The technical solution provided by the present invention has the following beneficial effects:
[0019] This paper proposes a personality detection model based on a residual-weighted dynamic graph convolutional network. This model introduces an adaptive residual weighting mechanism, which aims to weight important features along the feature propagation path, reduce noise interference, and enhance the expressiveness of key features. By dynamically adjusting information transfer between nodes using learnable residuals, the model strengthens the learning of stable personality traits, better eliminates interference from temporary user emotional characteristics embedded in text data, and thus improves sensitivity to truly important features. This paper provides a new approach to personality detection and demonstrates the potential of residual-weighted dynamic graph convolutional networks in addressing data noise issues.
[0020] This paper designs a weighted loss function to alleviate data imbalance, alleviating the problem of severely imbalanced class distribution in the dataset, which leads to insufficient prediction ability of the model for the minority class. This paper provides new insights into personality detection tasks and demonstrates the potential of residual weighted dynamic graph convolutional networks in addressing class imbalance.
[0021] The present invention extracts text features of posts through the pre-trained language model BERT and aggregates text features through a residual weighted dynamic graph convolutional network, thereby obtaining more accurate user representation and improving the accuracy of personality detection.
[0022] This invention primarily focuses on personality detection methods for social media user posts and has broad application prospects, potentially expanding into areas such as recommendation systems, dialogue systems, and game design. By mining and analyzing personality-related information contained in users' online texts and associating it with specific tags, it is possible to quickly understand users' personality traits, providing important support for personalized recommendations. For businesses, establishing an accurate personality detection model can help them deeply analyze user needs and customize products and services that better meet their expectations, thereby improving the user experience and enabling more precise marketing and promotional activities. At the same time, for users, personality analysis helps them more comprehensively understand and discover products and services that suit their needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is the overall flow chart of the method of the present invention;
[0024] Figure 2 This is a flow chart of steps (1)-(5) of the present invention. DETAILED DESCRIPTION
[0025] The present invention will be further analyzed below in conjunction with the accompanying drawings.
[0026] A personality detection method based on residual weighted dynamic graph convolutional network, such as Figure 1-2 As shown, the following steps are included:
[0027] Step (1) collects the text of users’ posts on social media; obtains the text feature vector of the post through the BERT pre-trained language model, and thus learns the semantic features of the text.
[0028] For each user's post set P = {p1, p2, ..., p N}, where N represents the number of texts. Each post contains M tokens, i∈[1,N]. Use the pre-trained language model BERT to encode each post and obtain the vector corresponding to each flag. Then take the vector corresponding to the "[CLS]" flag as the text feature vector containing context information, and obtain N text feature vectors h1,h2,…,h N .
[0029] h i =BERT(p i ) Formula (1)
[0030] Step (2): Based on the interaction relationship between users and the connection information of the social network platform, a directed relationship graph of users is constructed.
[0031] In the process of building R-DGCN, there are two types of nodes: user nodes and post nodes. The representation of post nodes uses the pre-trained language model BERT to obtain the word embedding vector H = {h1,h2,...,h N}.
[0032] Step (3): Construct the residual weighted dynamic graph convolutional network R-DGCN, and then dynamically learn the directed relationship graph through R-DGCN to obtain the user’s vector representation H out ;
[0033] After obtaining the directed graph in step (2), R-DGCN is used to specifically learn the personality characteristics in the posts to determine which posts can truly reflect the personality characteristics of the user and which posts only represent short-term characteristics.
[0034] The residual weighted dynamic graph convolutional network R-DGCN includes multiple layers, each of which includes a GraphMask and a Reserve Layer; wherein:
[0035] GraphMask trains a differentiable edge mask function to filter out edges that do not contribute much to the R-DGCN network prediction.
[0036]
[0037] and Represent the feature vectors of nodes u and v in the l-1 layer respectively, Represents the information between nodes u and v, a trained function g π Will be based on Generate Mask Indicates whether the edge between nodes u and v is retained. If Otherwise, it will not be retained.
[0038] Whether the edge between nodes is retained is achieved through the HardConcrete gating mechanism. The gating mechanism generates a hard mask through the following steps: (1) uniform distribution sampling, (2) logarithmic probability transformation and temperature scaling, (3) and then obtains the probability value through the sigmoid function. Based on the generated hard mask, it controls whether the edge is retained. After a layer of HardConcrete, a matrix G is obtained. (l) Represents the mask matrix.
[0039]
[0040] Where N is the number of nodes.
[0041] G (l) It will be multiplied with the original adjacency matrix A to remove unnecessary edges and dynamically adjust the graph structure to obtain the graph features after deleting useless edges. In order to balance the impact of the number of connections and the number of connections of a certain point on node propagation, the original adjacency matrix A is an all-one matrix.
[0042] At the same time, the normalized adjacency matrix of the original adjacency matrix A is calculated
[0043]
[0044] Where I represents the identity matrix and D represents the degree matrix.
[0045] The Reserve Layer normalizes the adjacency matrix and obtained Multiply them together and introduce the residual mechanism to obtain the final feature vector expression of the lth layer.
[0046]
[0047] Represents the normalized adjacency matrix, which is used to realize weighted information sharing. In the process of information dissemination, W l and Is the learnable parameter matrix of the current layer, responsible for the linear transformation of the feature message propagation to extract deeper features. In addition, the present invention introduces a residual weighting mechanism, through the learnable parameter matrix Dynamically adjusting the weights of the residual features enables the model to flexibly perform gradient descent based on the importance of the input features, thereby enhancing the representation of key features. Specifically, this mechanism can adaptively highlight important features and suppress the interference of irrelevant or minor features during feature propagation. This not only improves the model's ability to capture complex data patterns, but also significantly improves the model's robustness to noisy and unbalanced data.
[0048] By repeating the above operation, each layer of feature expression is obtained, and all feature expressions are overlapped to obtain H all .
[0049] H all =stack(H 1 ,H 2 ,...,H k ) Formula (7)
[0050] Where stack means overlap, k=l+1.
[0051] A trainable projection vector is used here Maps a feature dimension to a fraction of one dimension.
[0052]
[0053] Finally, we will get a final node feature vector representation H out ; Where R represents the real number domain, N is the number of nodes, and S is H all dimensionality reduction projection, is the adjusted weight tensor, and d is the feature dimension.
[0054] Step (4): transform the high-dimensional user representation vector H out Transformed into personality categories corresponding to the dimensions of personality traits.
[0055]
[0056] Where W u represents the trainable weight matrix, b u Indicates the offset; represents the predicted probability of the user's i-th personality category.
[0057] Step (5), according to the personality category vector Predict the user's personality category.
[0058] In the training process of R-DGCN, the cross entropy loss function is used as the loss function of gradient descent for back propagation. The concept of weighted value is introduced here, and different weighted values are set for a total of eight classes in the four classification tasks.
[0059]
[0060] where ω i,c represents the weighted value of the cth category in the i-th classification task, c represents the number of categories of personality traits, y i,c represents the true label of sample i in category c.
[0061] The performance evaluation of this paper uses the Kaggle MBTI dataset. The Kaggle dataset is derived from PersonalityCafe and contains a total of 8,675 Twitter user samples, each with 45-50 posts and corresponding personality tags. The following table shows the personality distribution of the Kaggle MBTI dataset:
[0062] type quantity I / E (Introversion / Extroversion) 6676 / 1999 S / N (Sensing / Intuition) 1197 / 7478 T / F (reason / feeling) 3981 / 4694 P / J (Judgment / Understanding) 5241 / 3434
[0063] Given the significant imbalance in the dataset, the experiment uses Macro-F1 as the personality detection performance evaluation metric. Macro-F1 is a variant of the F1-score, a commonly used evaluation metric for binary classification models in machine learning. The F1-score evaluation metric formula is as follows:
[0064]
[0065] Among them, precision and recall represent the classification accuracy and recall rate, respectively, which evaluate whether the model's positive example classification is accurate and the proportion of positive examples identified by the classifier to all positive examples. From the above definition, we can see that F1-score is an evaluation indicator that comprehensively considers the precision and recall rate of the classifier. By combining these two indicators, F1-score can more comprehensively evaluate the performance of the classifier in positive example classification.
[0066] Since traditional F1-score is mainly used to evaluate binary classification problems, the personality detection in the above experiment involves multi-label classification. Therefore, Macro-F1 is chosen as the main evaluation metric. Macro-F1 is the average of the F1-scores of each category, that is:
[0067]
[0068] The following table shows the results of personality testing performed on the Kaggle MBTI dataset. The aforementioned Macro-F1 was used as the evaluation metric. In the table, the "avg" column shows the average F1-score of the four personality traits:
[0069] Model I / E S / N T / F P / J avg Support Vector Machine 53.34 47.75 76.72 63.03 60.21 XGBoost 56.67 52.85 75.42 65.94 62.72 LSTM 57.82 57.87 69.97 57.01 60.67 BERT(MLP) 59.31 58.42 72.06 56.92 61.68 BERT (LSTM) 59.66 53.29 75.89 54.57 60.85 BERT (CNN) 62.32 56.18 76.15 62.90 64.39 BERT(att) 63.76 58.32 77.99 65.42 66.37 SN-Attn 65.43 62.15 78.05 63.92 67.39 Transformer-MD 66.08 69.10 79.19 67.50 70.47 D-DGCN 68.41 65.66 79.56 67.22 70.21 The present invention 67.95 68.52 80.31 65.72 70.62
[0070] The Macro-F1 score of R-DGCN is 0.15% and 0.41% higher than that of Transformer-MD and D-DGCN, respectively. Among the four binary classification tasks, R-DGCN performs particularly well in the T / F classification task, improving by 1.12% and 0.75% over Transformer-MD and D-DGCN, respectively.
Claims
1. A personality detection method based on residual weighted dynamic graph convolutional network, characterized in that: The method comprises the following steps: Collect user posts on social media and preprocess each post to obtain the text feature vector of the post; Construct user nodes, use the text feature vectors of posts as post nodes, and the user's posts on social media as directed edges to build a directed relationship graph of users; The residual weighted dynamic graph convolutional network (R-DGCN) is used to dynamically learn the directed relationship graph to obtain the user representation vector; the user representation vector is converted into a personality category vector corresponding to the dimension of personality characteristics; and the user's personality category is predicted based on the personality category vector.
2. The method according to claim 1, characterized in that The text feature vector of the post is obtained through the BERT pre-trained language model.
3. The method according to claim 1, characterized in that The residual weighted dynamic graph convolutional network R-DGCN includes GraphMask and Reserve Layer; wherein: GraphMask takes any two nodes in a directed graph as input, filters the edges through edge masking function and gating mechanism, dynamically adjusts the directed graph structure, and obtains the graph features after retaining the edges. The Reserve Layer introduces a residual mechanism to process the graph features after retaining the edges to obtain the feature vector expression of each layer; the feature vector expression of each layer is overlapped to obtain the fusion feature; Map the fused features to one dimension to obtain the final user representation vector.
4. The method according to claim 3, characterized in that The mapping is specifically: in is the projection vector, H all is the fusion feature, S is H all dimensionality reduction projection, is the adjusted weight tensor, d is the feature dimension, reshape represents the vector dimension conversion, H out Represents a vector for the user.
5. The method according to claim 4, characterized in that The user representation vector is converted into a personality category vector corresponding to the dimension of personality characteristics: Where W u represents the trainable weight matrix, b u Indicates the offset; represents the predicted probability of the user’s i-th personality category; MLP represents multi-layer perceptron.
6. The method according to claim 1, characterized in that In the process of training the residual weighted dynamic graph convolutional network R-DGCN, the cross entropy loss function is used as the loss function of gradient descent for back propagation, and a weighting mechanism is introduced, specifically: where ω i,c represents the weighted value of the cth category in the i-th classification task, c represents the number of categories of personality traits, y i,c represents the true label of the cth category in the i-th classification task.
7. A personality detection system implementing the method according to any one of claims 1 to 6, characterized in that: include: Data acquisition module, used to collect users' posts on social media; Text feature extraction module, used to obtain the text feature vector of the post; The personality detection module is used to construct a directed relationship graph based on the text feature vector of the post and use the residual weighted dynamic graph convolutional network R-DGCN to predict the user's personality category.
8. A computer storage medium having a corresponding computing program stored thereon, characterized in that: When the computing program is run on a computer, it is used to execute the steps of the method according to any one of claims 1 to 6.
9. A computing device comprising a memory and a processor, wherein the memory stores executable code, characterized in that: When executing the executable code, the processor implements the steps of the method according to any one of claims 1 to 6.