Method for personality detection based on social text and links
By collecting and processing social text data from inactive users on social media platforms, and utilizing graph attention networks and psycholinguistics, a graph neural network was constructed to solve the reliability problem of personality detection for inactive users, thus achieving more efficient automated personality detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-15
- Publication Date
- 2026-03-17
AI Technical Summary
Traditional automated personality testing methods have low reliability in detecting inactive users, making it difficult to effectively utilize inactive user data on social media platforms for accurate personality testing.
By collecting social text data from the neighbors of silent users on social media platforms, performing data cleaning and preprocessing, ranking friends based on the influence of links, extracting features using graph attention networks, and combining psycholinguistic knowledge, constructing graph neural networks for personality trait representation and classification.
The reliability of automated results for personality detection of inactive users has been improved, and the accuracy of personality detection has been significantly enhanced through appropriate data processing and ranking of high-influence friends.
Smart Images

Figure CN116186423B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of machine learning and detection technology, and relates to a personality detection method based on social text and links. Background Technology
[0002] Personality detection is a task that automatically predicts the affiliation of individuals to psychological personality models based on their behavioral characteristics, verbal statements, and emotional states. With the development of Natural Language Processing (NLP), researchers have proposed the task of personality detection from text. This automatically predicts the personality of a candidate based on their verbal statements. Social text, derived from social media posts by users on social media platforms, provides a rich source of textual features for training personality detection tasks. Linkage is an important attribute in online social networks, including user follows and mentions of user interactions. It reflects the structural characteristics of different users within the same platform and enhances users' social network expression. Linkage plays a crucial role in community structure discovery, social network propagation, and user identification and association. The main challenges of text-based personality detection lie in two aspects: data issues and the expression of user groups. However, in implementing this invention, the inventors discovered that traditional automated personality detection methods still suffer from the technical problem of low reliability in personality detection results for silent users. Summary of the Invention
[0003] To address the problems existing in the aforementioned traditional methods, this invention proposes a personality detection method and a personality detection device based on social text and links, which can significantly improve the reliability of automated personality detection results.
[0004] To achieve the above objectives, the embodiments of the present invention adopt the following technical solutions:
[0005] On the one hand, a personality detection method based on social text and links is provided, including the following steps:
[0006] Collect social text data and MBTI classification tags from the neighbors of silent users on social media platforms;
[0007] The social text data of neighboring users is cleaned and illegal data is removed to obtain a preprocessed text dataset.
[0008] In the preprocessed text dataset, sort friends based on the influence of links to obtain a list of high-influence friends of inactive users;
[0009] In the posts of friends in the high-influence friend list, high-quality friend posts are selected as the posts of inactive users by using language exploration and word count dictionaries;
[0010] Based on graph attention networks, feature extraction is performed using the post representations of silent users to obtain the personality trait representations of silent users;
[0011] The personality trait representations and MBTI classification labels of silent users are input into a personality classification model based on the average binary cross-entropy objective function for classification processing, and the final MBTI personality labels of silent users are output.
[0012] On the other hand, a personality detection device based on social text and links is also provided, including:
[0013] The data acquisition module is used to collect social text data and MBTI classification tags from the neighbors of silent users on social media platforms.
[0014] The preprocessing module is used to clean the social text data of neighboring users, removing illegal data from the social text data of neighboring users to obtain the preprocessed text dataset;
[0015] The Friend List module is used to sort friends based on link influence in a preprocessed text dataset and obtain a list of high-influence friends of inactive users.
[0016] The post representation module is used to select high-quality friend posts from the high-influence friend list as the post representation of inactive users by using language exploration and word count dictionaries.
[0017] The feature extraction module is used to extract features from the post representations of silent users based on graph attention networks, thereby obtaining the personality trait representations of silent users.
[0018] The classification output module is used to input the personality trait representations and MBTI classification labels of silent users into a personality classification model based on the average binary cross-entropy objective function for classification processing, and output the final MBTI personality labels of silent users.
[0019] One of the above technical solutions has the following advantages and beneficial effects:
[0020] The aforementioned personality detection method based on social text and links uses a novel dataset: social text data of neighbors of silent users on social media platforms, along with their corresponding MBTI classification labels. Data preprocessing cleans the text data of illegal characters. Then, a list of high-influence friends of silent users is obtained through link-based friend influence ranking. Personality trait (vector) representations of silent users are extracted using graph attention networks. Finally, automated personality classification is achieved through multiple linear layers. Compared to traditional techniques, this approach, through appropriate data processing, designs a link-based high-influence friend ranking and friend post measurement method for representing silent users' posts, and constructs a graph neural network incorporating psycholinguistic knowledge to highlight the personality representations of silent users. This solves a critical technical problem in the field of text-based silent user personality detection, thus significantly improving the reliability of automated personality detection results. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the conventional technology, the drawings used in the description of the embodiments or the conventional technology will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a flowchart illustrating a personality detection method based on social text and links in one embodiment;
[0023] Figure 2 This is a schematic diagram of the friend list retrieval process in one embodiment;
[0024] Figure 3 This is a schematic diagram of the feature extraction process in one embodiment;
[0025] Figure 4 This is a schematic diagram illustrating the application process of a personality detection method based on social text and links in one embodiment;
[0026] Figure 5 This is a schematic diagram of the module structure of a personality detection device based on social text and links in one embodiment. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
[0029] It should be noted that, in this document, the reference to "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The presentation of this phrase in various locations throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments.
[0030] Those skilled in the art will understand that the embodiments described herein can be combined with other embodiments. The term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items, and all possible combinations thereof.
[0031] Personality is a set of characteristic behavioral, cognitive, and emotional patterns evolved from biological and environmental factors. Psychologists have proposed various psychological models to describe individual personality, among which the most widely used are the Myers-Briggs Type Indicator Model (MBTI) and the Big Five Personality Model. The MBTI model expands upon Jung's eight personality types into 16, dividing personality into four dimensions: attentional orientation, cognitive style, judgment style, and lifestyle. The Big Five Personality Model, also known as the Five-Factor Model, divides personality into five dimensions: openness, conscientiousness, appearance, agreeableness, and neuroticism.
[0032] In text-based personality testing research, the quality of the data profoundly impacts the final model performance. Existing personality testing datasets include those from the my-personality dataset, the essay dataset, and the Kaggle-MBTI dataset. Based on these datasets, existing personality testing methods include 2CLSTM and TrigNet. Due to ethical and labeling concerns, existing datasets face issues such as outdated data, small size, imbalanced positive and negative sample sizes, and no longer being publicly available. The essay dataset, for example, is outdated and its content is unsuitable for personality testing analysis in the context of online social networks, and its size is also too small. While the Kaggle-MBTI dataset is publicly available, most of its data labels are imbalanced; the my-personality dataset is no longer publicly available or shared due to privacy and ethical considerations.
[0033] Social media platform users can be categorized into active users and silent users based on the amount of social text data posted by their neighbors. While the number of users on social media platforms has reached 4.48 billion, not all users are active. Research indicates that a large portion of social media users are silent. However, this type of user has been largely overlooked in past studies on personality assessment based on text. Furthermore, the applicant's research found that silent users never post any comments, making it impossible to directly use their posts for user representation; they can only express themselves through posts from friends based on link relationships. Additionally, the friends of silent users may have a large number of posts, further increasing the difficulty of personality assessment based on social text. Graph attention networks, a mainstream graph learning method, have demonstrated strong personality representation extraction capabilities in the applicant's recent personality assessment research and are also suitable for incorporating psycholinguistic knowledge to guide feature extraction.
[0034] Therefore, how to perform appropriate data processing, design a method for ranking high-influence friends and measuring friend posts based on link relationships to represent the posts of silent users, and construct a graph neural network that incorporates psycholinguistic knowledge to highlight the personality representation of silent users are technical issues of great concern in the field of silent user personality detection based on text.
[0035] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0036] Please see Figure 1 In one embodiment, this application provides a personality detection method based on social text and links, including the following processing steps S12 to S20:
[0037] S12 collects social text data and MBTI classification labels from neighboring users of silent users on social media platforms.
[0038] It's understandable that social media platforms can be any existing social network. Taking the commonly used T platform as an example, we can collect the follower list data of inactive users from the T platform, along with the users' public tweets from that list, as the social text data of their neighbors. We can then obtain the corresponding MBTI tags from the Personality database as classification labels. When a user has multiple classification labels for the same personality model, the personality label with the highest number of votes is selected as the required classification label based on the number of votes received on the website. Therefore, for inactive users who need to undergo personality testing, we can directly collect their neighboring users' social text data and tags from the social media platforms they regularly use as the dataset.
[0039] S14, clean the social text data of neighboring users, remove illegal data from the social text data of neighboring users to obtain the preprocessed text dataset.
[0040] Understandably, to ensure the proper use of the collected dataset in subsequent steps, data preprocessing is necessary. Specifically, several cleaning operations are performed on the social text data of each inactive user's neighbors: First, the text content is lowercase; then, emojis in the text are converted into emotional text using the demoji method of the existing Python emoji library; next, each character is checked for legality based on its Unicode encoding value, and illegal characters are removed; finally, links are checked for in the text using existing regular expression rules, and if found, they are removed. During model training, the preprocessed social text data of neighbors and the corresponding collected MBTI tags can be divided into training and testing sets in a 4:1 ratio for model training and testing, respectively.
[0041] S16: Sort the friends based on the influence of links in the preprocessed text dataset to obtain the list of high-influence friends of inactive users.
[0042] Understandably, based on the principle of "one is influenced by one's company," the influence of a friend can be determined from factors such as the duration and frequency of a silent user's attention to their friends in their friend list. By sorting friend influence based on links, a list of high-influence friends of silent users can be selected.
[0043] S18: In the posts of friends in the high-influence friend list, high-quality friend posts are selected as the posts of inactive users by using language exploration and word count dictionaries.
[0044] It is understandable that for silent users who do not post, posts from their high-influence friends list are used to represent them. Therefore, for each silent user, high-quality friend posts are selected using the LinguisticInquiry and Word Count (LIWC) dictionary to represent the silent user's posts.
[0045] S20: Based on graph attention network, feature extraction is performed using the post representations of silent users to obtain the personality trait representations of silent users.
[0046] Understandably, for the current silent users, this application adopts feature extraction based on graph attention networks, that is, constructing a binary graph that introduces psycholinguistic knowledge through a "language exploration and word count" dictionary and performing graph attention network learning, thereby obtaining the personality representation of silent users.
[0047] S22 inputs the personality trait representation and MBTI classification label of the silent user into the personality classification model based on the average binary cross-entropy objective function for classification processing, and outputs the final MBTI personality label of the silent user.
[0048] It is understandable that a personality classification model based on the average binary cross-entropy objective function can be trained by pre-collecting social text data and tags of the neighboring users on the social media platforms used by each silent user on a daily basis, dividing them into training and test sets, and using the same processing as the previous steps to continuously update the parameters of the graph attention network and the entire personality classification model until the test results meet the set index requirements for real-world applications. This model can then be used to perform personality detection on unknown silent users who currently have no labels and obtain their final MBTI personality labels.
[0049] The aforementioned personality detection method based on social text and links uses a novel dataset: social text data of neighbors of silent users on social media platforms, along with their corresponding MBTI classification labels. Data preprocessing cleans the text data of illegal characters. Then, a list of high-influence friends of silent users is obtained through link-based friend influence ranking. Personality trait (vector) representations of silent users are extracted using graph attention networks. Finally, automated personality classification is achieved through multiple linear layers. Compared to traditional techniques, this approach, through appropriate data processing, designs a link-based high-influence friend ranking and friend post measurement method for representing silent users' posts, and constructs a graph neural network incorporating psycholinguistic knowledge to highlight the personality representations of silent users. This solves a critical technical problem in the field of text-based silent user personality detection, thus significantly improving the reliability of automated personality detection results.
[0050] In one embodiment, such as Figure 2 As shown, further, step S16 above can specifically include the following processing:
[0051] S161, based on user interaction priority settings, iterate through the friends' following list of silent users after sorting by friend influence;
[0052] S163, If a currently traversed friend has been mentioned and the number of posts exceeds the set minimum number of posts, then add the currently traversed friend to the list of high-influence friends.
[0053] S165: If the length of the high-influence friend list reaches the set maximum number of high-influence friends when the traversal ends, then return the high-influence friend list of the silent user.
[0054] Understandably, based on the principle of "one is influenced by one's company," three priority settings for friend selection based on link relationships were established. These three priority settings are:
[0055] A. User Interaction Priority (IISA): Select high-influence friends from the users currently being followed by the target user (i.e., the silent user whose personality needs to be tested and whose MBTI label needs to be determined). These high-influence friends should have a certain scale (the specific scale can be set according to the social characteristics of users in different regions and fields) of followers and posts. They should also be followed by silent users, have posts liked, and have a significant number of likes.
[0056] B. User Post Quantity Priority (MPF): Select high-influence friends from the users that the target is following. These high-influence friends should have a certain scale (the specific scale can be set according to the social characteristics of users in different regions and fields) of followers and posts.
[0057] C. User Follower Priority (MFF): Select high-influence friends from the users currently followed by the target, where the number of users followed by the high-influence friend should be greater than the number of users followed by the friend.
[0058] Specifically, based on the aforementioned three friend selection priority settings, an empty high-influence friend list (HIFL) can be set, and the following list (FOWL) of the target object can be input. First, the user interaction priority (IISA) setting can be applied, and the sorted FOWL friends can be traversed. For the i-th friend traversed, if this friend is mentioned and the number of posts is higher than the set minimum post count N, then... min If the friend is found to be a high-influence friend, add them to HIFL. After iteration, check if the length of HIFL has reached the maximum set number N of high-influence friends. xh If the length of HIFL is equal to N xh If so, the HIFL list is returned directly. Minimum post size N min Maximum number of high-influence friends N xh The specific values can be preset according to the needs of the actual application scenario, as long as they can help improve the accuracy of the detection results.
[0059] Through the above processing, HIFL can be quickly obtained and returned by using link-based friend influence sorting.
[0060] In one embodiment, further, step S16 above may include the following processing steps:
[0061] If the length of the list of high-influence friends exceeds the maximum number of high-influence friends set at the end of the iteration, then each item in the list of high-influence friends will be reordered according to the number of times it is mentioned.
[0062] Select the top N after reordering xh Select 1 candidate friend as a high-influence friend and return the list of high-influence friends of the inactive user; N xh This is the maximum number of high-influence friends you can set.
[0063] It's understandable that after the traversal ends, we check if the length of HIFL has reached the maximum number N of high-influence friends. xh If the HIFL length exceeds N xh Then, each item in HIFL is sorted according to its mention count, and the top N items are selected. xhSelect candidate friends as the high-influence friends of the inactive user and return the HIFL list. Through the above processing, the link-based friend influence ranking is used to achieve fast HIFL retrieval and return in another scenario.
[0064] In one embodiment, step S16 described above may further include the following processing steps:
[0065] If the length of the high-influence friend list is less than the maximum number of high-influence friends set at the end of the traversal, then select high-influence friends from the friends in the following list who are not selected, and add them to the high-influence friend list if they meet the user's post volume priority setting or the user's follow volume priority setting.
[0066] When the length of the list of high-influence friends reaches the set maximum number of high-influence friends, return the list of high-influence friends of the inactive user.
[0067] It is understandable that if the HIFL length is less than N... xh Further, based on either the number of user posts (MPF) or the number of user followers (MFF) setting, select high-influence friends from the unselected friends who meet either the MPF or MFF setting, until the HIFL length reaches N. xh And return the HIFL list. Through the above processing, we can achieve fast retrieval and return of HIFL in another scenario by using link-based friend influence sorting.
[0068] In one embodiment, step S18 described above may specifically include the following processing steps:
[0069] Initialize the current inactive user post set corresponding to the inactive user and the metric score set for each friend in the high-influence friend list;
[0070] For friend i, iterate through the categories corresponding to each MBTI category tag and select a category set containing q language exploration and word count dictionary psychological categories. Count the number of words belonging to the j-th psychological category in friend i's posts; i∈[1, N]. xh ], j∈[1, C], N xh C represents the maximum number of high-influence friends, C represents the total number of categories in the category set, and q represents a positive integer not less than 2.
[0071] Based on the category set and word count of the language exploration and word count dictionary, calculate the sum of the metric scores of all categories for friend i and add it to the metric score set corresponding to friend i.
[0072] Select the posts with the highest metric rating (l) as posts of friend i and add them to the current silent user's post set; l is a positive integer not less than 2.
[0073] Specifically, iterate through the HIFL list. For the i-th friend in HIFL, initialize the metric rating set S. i ={}; Initialize the current silent user post set P = {}. Iterate through each category and select a category set C = {c0, c1, ..., cq} containing q LIWC psychological categories. q}, for the i-th post p i ={w1,w2,…,w n The dataset contains n words. Count the number of words belonging to the j-th psychological category, n. j Calculate the total score for all categories using the following formula: And add it to the metric score set S i Among them, the ranking corresponds to the metric score set S. i The system selects the top l posts with the highest metric rating as the friend's posts and adds them to the current inactive user post set P. This method efficiently and accurately selects high-quality friend posts as representations of inactive users' posts.
[0074] In one embodiment, such as Figure 3 As shown, step S20 above can specifically include the following processing steps:
[0075] S201, Based on the category set of the language exploration and word count dictionary and the current silent user post set, construct a binary graph containing psychological category nodes and post nodes for silent users;
[0076] S203, obtain the number of attention heads of the input graph attention network, and set the graph attention network optimizer and learning rate;
[0077] S205, use a graph attention network to calculate the score of each edge between the mental category node and the post node in the binary graph, and calculate the attention score of the category node embedding to the K-th head of the silent user post node in the binary graph; K is a positive integer not less than 2;
[0078] S207 uses a normalized exponential function to normalize the attention score to obtain the updated hidden state of the post node and outputs the personality trait representation of the silent user.
[0079] Understandably, this approach utilizes the LIWC (Language Exploration and Word Counting) dictionary to introduce psycholinguistic knowledge, constructing a binary graph containing both psychological category nodes and post nodes for each silent user to be detected. Then, a graph attention network is used to extract features from the constructed binary graph.
[0080] Specifically, the number of attention heads in the graph attention network is set to K, the graph attention network optimizer can be set to Adam, and the learning rate can be set to 0.00001. For each silent user to be detected, the corresponding binary graph G = (V, E) and node embedding X = X... c ∪X p Here, V is the set of nodes containing posts and categories, and E is the set of edges connecting all post nodes to mental category nodes. First, the score of each edge [i,j] between a post node and a category node is calculated. up to the kth head Attention score:
[0081]
[0082] Among them, a k and It is a learnable weight matrix, and σ(·) is the LeakyReLU activation function.
[0083] The attention score is normalized using softmax, for the k-th head. up to the kth head The normalized attention score is: Where, N i It is node v pj The neighbor nodes. Obtain the updated hidden state of the post node. The hidden state of the i-th post node, obtained by the weighted sum of the feature vectors of its neighbor nodes, is: in These are the learnable weights, and K is the number of attention heads. The personality traits ultimately extracted through the graph attention network are represented as follows: It has high reliability.
[0084] In one embodiment, the step of constructing a binary graph containing psychological category nodes and post nodes for silent users based on the category set of the language exploration and word count dictionary and the current silent user post set may further include the following processing:
[0085] After initializing the node set, combine the category set of the language exploration and word count dictionary psychological category and the current silent user post set into the node set;
[0086] After initializing the edge set, based on the language exploration and word count dictionary, traverse each post in the current silent user's post set and the psychological category to which the words in the post belong, and add the index to the edge set of the current silent user;
[0087] The categories of the node sets are added as special words to the Bert tokenizer, and Bert is called to process each word to obtain the category node embedding;
[0088] Insert a special marker [CLS] at the first position and a special marker [SEP] at the last position of each post in the node set to obtain the marker sequence, and then obtain the embedding of the silent user post node from Bert.
[0089] Understandably, further, by utilizing the LIWC (Language Exploration and Word Count) dictionary and incorporating psycholinguistic knowledge, a binary graph containing both psychological categories and post nodes can be constructed for each silent user. The specific approach for each silent user is as follows:
[0090] Construct the node set. Initialize the node set V = {}; select the preset psychological category set C = {c0, c1, ..., c} from the "Language Exploration and Word Count" dictionary LIWC. q}, and the set of posts of currently silent users P = {p1, p2, ..., p} r} and construct a node set, where r = l·N xh .
[0091] Construct the edge set. Initialize the edge set E = {}; based on the "Language Exploration and Word Counting" dictionary LIWC, traverse the current inactive user's post set for each post and the psychological category to which the words in the post belong, and add the index to the current user's edge set. Let the i-th post p... i ={w1,w2,…,w n}, the j-th category c j For example, where w k (1≤k≤n) According to the "Language Exploration and Word Count Statistics" dictionary LIWC, it belongs to c. j If so, then add the indices [i,j] and [j,i] to the edge set E.
[0092] Category node embedding. First, category node embedding is performed. Category nodes are added as special words to the BERT tokenizer. For each word, BERT is called, i.e.: d represents the output dimension of BERT. The final category node embedding is obtained.
[0093] Post node embedding. For the i-th post p containing n words... i ={w1,w2,…,w n Insert a special marker [CLS] at the first position of the post, insert a special marker [SEP] at the last position of the post, and obtain the marker sequence T. pi ={t1,t2,…,t n+2}, and retrieve the text embedding from BERT. d represents the output dimension of BERT. The final embedding of the silent user post node is as follows: In this way, the construction of the binary graph was completed efficiently.
[0094] In one embodiment, the training and acquisition process of a personality classification model based on the average binary cross-entropy objective function includes:
[0095] Set the model optimizer for the personality classification linear layers to Adam, with a learning rate of 0.001. Each linear layer has an input dimension of d and an output dimension of 2, and initialize T linear layers; d is the output dimension of Bert, and T is the number of MBTI personality dimensions.
[0096] Based on the personality traits of silent users, mean pooling is used to generate the final representation of silent users.
[0097] By using the final representation of silent users, T personality dimensions are predicted through T linear layers with a normalized exponential function, thus obtaining the label prediction probability of the personality dimensions.
[0098] Based on the real labels of samples from each personality dimension, the learnable parameters of the graph attention network and the personality classification model are updated using a gradient based on the objective function of average binary cross-entropy.
[0099] After loading the model parameters, graph attention network, and linear layer saved after gradient update, the pre-collected test data is input into the graph attention network to extract features. The extracted personality trait representation is then input into the personality classification model to obtain the prediction result.
[0100] Input the real labels of the personality dimension samples into the personality classification model and adjust the hyperparameters according to the test results until the test indicators of the personality classification model reach the design indicators to complete the training; the hyperparameters include the number of attention heads of the graph attention network, and the test indicators include accuracy and F1 score.
[0101] It's understandable that, whether in actual detection or model training, after obtaining the personality trait representation of silent users through the aforementioned steps, it can be used for personality classification of those silent users. Specifically, the model optimizer for the personality classification linear layers is set to Adam, with a learning rate of 0.001. Each linear layer has an input dimension of d and an output dimension of 2, and T linear layers are initialized. Mean pooling is then used to generate the final representation of silent users:
[0102] T personality dimensions are predicted using T linear layers with a normalized exponential function (softmax). Since the MBTI personality test has four dimensions, T is set to 4. The predicted probabilities are: in, and y represents the trainable weights and biases in the t-th linear layer. t It is the label value of the t-th personality dimension.
[0103] The objective function of the personality classification model is the average binary cross-entropy, which is:
[0104]
[0105] Where D is the length of the training set. Let d be the true label of the t-th personality dimension sample. yes Predicted probability under parameter θ.
[0106] Gradient updates are performed using the objective function to update the learnable parameters of both the graph attention network and the personality classification model. After training, the parameters of both the graph attention network and personality classification models are saved.
[0107] Regarding model evaluation and application: Complete the training and testing of the personality detection model for silent users for the final personality detection application. The model testing method is as follows:
[0108] The saved personality classification model parameters are loaded, along with a graph attention network and linear layers. Test data is then input into the graph attention network to extract features. Subsequently, the data is input into the personality classification model to obtain prediction results. Afterward, the correct labels of the input samples are given, and some hyperparameters (including the number of graph attention network heads K mentioned above) are adjusted based on the test metric results to optimize the model metrics (i.e., meet the given design requirements). The test metrics include accuracy and F1 score.
[0109] Finally, the optimal personality classification model can be applied. For example, for unknown silent users without labels, data collection, data preprocessing, link-based ranking of high-influence friends, friend post measurement, and graph attention network feature extraction are performed to obtain the personality representation of the unknown silent user. The final MBTI personality label for the unknown silent user is then obtained through the personality classification model. This MBTI personality label is a multidimensional personality label. Thus, the personality detection of silent users based on link relationships and graph attention networks is completed. Figure 4 As shown in the flowchart, one specific application of the above-mentioned detection method of this application has been tested and verified in practice, and the detection results are highly reliable.
[0110] It should be understood that, although Figures 1 to 4 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order in which these steps are executed; they can be performed in other orders. Figures 1 to 4At least some of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0111] Please see Figure 5 In one embodiment, a personality detection device 100 based on social text and links is provided, including a data acquisition module 11, a preprocessing module 12, a friend list module 13, a post representation module 14, a feature extraction module 15, and a classification output module 16. The data acquisition module 11 collects social text data of neighboring users and MBTI classification labels from a social media platform. The preprocessing module 12 cleans the neighboring user social text data, removing illegal data to obtain a preprocessed text dataset. The friend list module 13 sorts the preprocessed text dataset based on the influence of linked friends to obtain a list of high-influence friends of the silent user. The post representation module 14 selects high-quality friend posts from the posts of friends in the high-influence friend list as the post representation of the silent user using a language exploration and word count dictionary. The feature extraction module 15 extracts features from the post representation of the silent user using a graph attention network to obtain a personality trait representation of the silent user. The classification output module 16 is used to input the personality trait representation and MBTI classification label of silent users into a personality classification model based on the average binary cross-entropy objective function for classification processing, and output the final MBTI personality label of silent users.
[0112] The aforementioned personality detection device 100 based on social text and links, through the collaboration of various modules, collects social text data of neighboring users of silent users on social media platforms, along with the corresponding MBTI classification labels, as a novel dataset. It preprocesses the text data to remove illegal characters, then obtains a list of high-influence friends of silent users based on link-based friend influence ranking, and extracts personality traits (vector representations) of silent users through graph attention network feature extraction. Finally, it achieves automated personality classification through multiple linear layers. Compared to traditional techniques, this solution, through appropriate data processing, designs a high-influence friend ranking and friend post measurement method based on link relationships to represent the posts of silent users, and constructs a graph neural network incorporating psycholinguistic knowledge to highlight the personality representation of silent users. This solves a critical technical problem in the field of text-based silent user personality detection, thereby significantly improving the reliability of automated personality detection results.
[0113] For specific limitations regarding the personality detection device 100 based on social text and links, please refer to the corresponding limitations of the personality detection method based on social text and links above, which will not be repeated here. Each module in the aforementioned personality detection device 100 based on social text and links can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of a device with specific data processing functions, or stored in software in the memory of the aforementioned device, so that the processor can call and execute the operations corresponding to each module. The aforementioned device can be, but is not limited to, various types of data processing devices already existing in the art.
[0114] In one embodiment, a data processing device is also provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following processing steps: collecting social text data of neighboring users of a silent user on a social media platform and MBTI classification labels; cleaning the social text data of neighboring users to remove illegal data and obtain a preprocessed text dataset; sorting the preprocessed text dataset based on the influence of linked friends to obtain a list of high-influence friends of the silent user; selecting high-quality friend posts from the posts of friends in the list of high-influence friends using a language exploration and word count dictionary as the post representation of the silent user; extracting features from the post representation of the silent user using a graph attention network to obtain the personality trait representation of the silent user; inputting the personality trait representation and MBTI classification labels of the silent user into a personality classification model based on the average binary cross-entropy objective function for classification processing, and outputting the final MBTI personality label of the silent user.
[0115] It is understood that, in addition to the memory and processor mentioned above, the data processing device also includes other hardware and software components not listed in this specification. The specific components can be determined according to the model of the data processing device in different application scenarios, and will not be listed and described in detail in this specification.
[0116] In one embodiment, when the processor executes the computer program, it can also implement the steps or sub-steps added in the various embodiments of the personality detection method based on social text and links described above.
[0117] In one embodiment, a computer-readable storage medium is also provided, on which a computer program is stored. When executed by a processor, the computer program performs the following processing steps: collecting social text data of neighboring users of a silent user on a social media platform and MBTI classification labels; cleaning the social text data of neighboring users to remove illegal data and obtain a preprocessed text dataset; sorting the preprocessed text dataset based on the influence of linked friends to obtain a list of high-influence friends of the silent user; selecting high-quality friend posts from the posts of friends in the list of high-influence friends using a language exploration and word count dictionary as the post representation of the silent user; extracting features from the post representation of the silent user using a graph attention network to obtain the personality trait representation of the silent user; inputting the personality trait representation and MBTI classification labels of the silent user into a personality classification model based on the average binary cross-entropy objective function for classification processing, and outputting the final MBTI personality label of the silent user.
[0118] In one embodiment, when the computer program is executed by a processor, it can also implement the steps or sub-steps added to the various embodiments of the personality detection method based on social text and links described above.
[0119] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), memory bus DRAM (RDRAM), and interface DRAM (DRDRAM), etc.
[0120] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0121] The above embodiments merely illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, all of which fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for personality detection based on social text and links, characterized in that, The method comprises the steps of: Collecting neighbor user social text data and MBTI classification labels of a silent user on a social media platform; obtaining the MBTI label of the corresponding user from a personality type database as a classification label; when a user has multiple classification labels of the same personality model, selecting the personality label with the highest number of votes according to the number of votes on the website as the required classification label; Cleaning the neighbor user social text data to remove illegal data in the neighbor user social text data to obtain a preprocessed text data set; Sorting the high-influence friends list of the silent user based on link-based friend influence in the preprocessed text data set; Friend influence is determined from the silent user's attention duration and mention frequency of friends in the friend list; In the post of the friend in the high-influence friend list, high-quality friend posts are selected as the post representation of the silent user by using language exploration and word count dictionary; This includes: initializing the current set of posts for the inactive user and the set of metrics and ratings for each friend in the list of high-influence friends; for friends i Iterate through the categories corresponding to each MBTI category label and select those containing... q A language exploration and word count dictionary, a psychological category set, and a count of friends. i The post belongs to the first j The word count for each psychological category; based on the category set of the psychological categories in the language exploration and word count dictionary and the word count, calculate the number of friends. i The sum of all categories' scores and added to the friend list. i The corresponding set of metrics and scores; select the metrics and scores that appear first. l The post was made by the friend mentioned. i The post is then added to the current silent user's post collection; l It is a positive integer not less than 2; i ∈[1, N xh ], j ∈[1, C ], N xh The maximum number of high-influence friends. C The total number of categories contained in the category set. q It is a positive integer not less than 2; Feature extraction is performed based on a graph attention network using the post representation of the silent user to obtain the personality trait representation of the silent user; The personality trait representation of the silent user and the MBTI classification label are input into a personality classification model based on the average binary cross-entropy objective function for classification processing, and the final MBTI personality label of the silent user is output. 2.The social-text-and-link-based personality detection method of claim 1, wherein, The step of sorting the high-influence friends list of the silent user based on link-based friend influence in the preprocessed text data set comprises: According to the user interaction priority setting, traverse the attention list friends of the silent user after friend influence sorting; If the current traversed friend is mentioned and the post volume is higher than the set minimum post volume, the current traversed friend is added to the high-influence friend list; If the length of the high-influence friend list reaches the set maximum number of high-influence friends at the end of the traversal, the high-influence friend list of the silent user is returned. 3.The social-text-and-link-based personality detection method of claim 2, wherein, The step of sorting the high-influence friends list of the silent user based on link-based friend influence in the preprocessed text data set further comprises: If the length of the high-influence friend list exceeds the set maximum number of high-influence friends at the end of the traversal, each item in the high-influence friend list is reordered according to the number of mentions; selecting top N xh highly influential friends from the reordered candidate friends and returning a list of highly influential friends for the silent user; N xh a set maximum number of highly influential friends. 4.The social-text-and-link-based personality detection method of claim 2, wherein, The step of sorting the high-influence friends list of the silent user based on link-based friend influence in the preprocessed text data set further comprises: If the length of the high-influence friend list is less than the set maximum number of high-influence friends at the end of the traversal, high-influence friends that meet the user post volume priority setting or the user attention volume priority setting are selected from the unselected friends in the attention list friends and added to the high-influence friend list; When the length of the high-influence friend list reaches the set maximum number of high-influence friends, the high-influence friend list of the silent user is returned.
5. The social-text-and-link based personality detection method of claim 1, wherein, The step of feature extraction based on a graph attention network using the post representation of the silent user to obtain the personality trait representation of the silent user comprises: According to the category set of the language exploration and word count dictionary psychological category and the current silent user post set, a binary graph containing psychological category nodes and post nodes is constructed for the silent user; The number of attention heads of the input graph attention network is obtained, and a graph attention network optimizer and a learning rate are set; computing scores for each edge between the binary graph center mental category nodes and the hashtag nodes using the graph attention network, computing the category node embeddings in the binary graph to the first K attention scores for the head silent user hashtag node embeddings; K is a positive integer no less than 2; The attention score is normalized using a normalized exponential function to obtain an updated post node hidden state, and the personality trait representation of the silent user is output.
6. The social-text-and-link based personality detection method of claim 5, wherein, According to the category set of the language exploration and word count dictionary psychological category and the current silent user post set, a binary graph containing psychological category nodes and post nodes is constructed for the silent user, including: After initializing the node set, the language exploration and word count dictionary category set and the current silent user post set are combined into a node set; After initializing the edge set, according to the language exploration and word count dictionary, each post in the current silent user post set and the psychological category of the words in the post are traversed, and the index is added to the edge set of the current silent user; The categories of the node set are added as special words to the word segmentation of Bert, and the category node embedding is obtained by calling Bert for each word; Special marks [CLS] and [SEP] are inserted into the first position and the last position of each post in the node set respectively to obtain a mark sequence and obtain the silent user post node embedding from Bert. 7.The social-text-and-link based personality detection method of claim 1, wherein, The training process of the personality classification model based on the average binary cross entropy objective function includes: The model optimizer of setting the personality classification linear layer is Adam, the learning rate is 0.001, the input dimension of each linear layer is d , the output dimension is 2 and the initialization T linear layer; d is the output dimension of Bert, T is the number of MBTI personality dimensions; According to the personality trait representation of the silent user, the final representation of the silent user is generated using mean pooling; The final representation of the silent user is utilized to predict a label probability for a personality dimension using a linear layer with a normalized exponential function T linear layer prediction T personality dimensions, obtaining a label prediction probability for a personality dimension According to the true label of each personality dimension sample, the learnable parameters of the graph attention network and the personality classification model are updated by the average binary cross entropy objective function; After loading the model parameters saved after gradient update, the graph attention network and the linear layer, the test data collected in advance is input into the graph attention network to extract features, and the extracted personality trait representation is input into the personality classification model to obtain the prediction result; The true label of the personality dimension sample is input into the personality classification model, and the hyperparameters are adjusted according to the test result until the test index of the personality classification model reaches the design index to complete the training; The hyperparameters include the number of attention heads of the graph attention network, and the test index includes accuracy and F1 score.
8. A personality detection device based on social text and links, characterized in that, It includes: The data acquisition module is used for collecting the neighbor user social text data and MBTI classification label of the silent user on the social media platform; The MBTI label of the corresponding user is obtained from the personality type database as the classification label, and when the same user appears in a user with multiple classification labels of the personality model, the personality label with the highest number of votes is selected as the required classification label according to the number of votes on the website; The preprocessing module is used for cleaning the neighbor user social text data to obtain the preprocessed text data set by removing illegal data in the neighbor user social text data; The friend list module is configured to sort link-based friend influence in the preprocessed text data set, and obtain a high-influence friend list of the silent user; The friend influence is determined according to the attention time length and the mention frequency of the silent user to the friends in the friend list; The post representation module is configured to select high-quality friend posts as the post representation of the silent user from the posts of the friends in the high-influence friend list by using language exploration and word count statistics dictionary; The method comprises the following steps: initializing a current silent user post set corresponding to the silent user and a metric score set corresponding to each friend in the high-influence friend list; for each friend i , traversing each category corresponding to an MBTI classification label, selecting a category set containing q language exploration and word count dictionary psychological categories, counting the number of words in the posts of the friend i belonging to the j th psychological category; calculating the sum metric score of all categories of the friend i according to the category set of the language exploration and word count dictionary psychological categories and the word count, and adding the sum metric score to the metric score set corresponding to the friend i ; selecting the post with the top l metric score as the post of the friend i and adding the post to the current silent user post set; l is a positive integer not less than 2; i ∈[1, N xh ], j ∈[1, C ], N xh is the maximum number of high-influence friends, C is the total number of categories in the category set, q is a positive integer not less than 2; The feature extraction module is configured to perform feature extraction on the post representation of the silent user based on a graph attention network, and obtain a personality trait representation of the silent user; The classification output module is configured to input the personality trait representation of the silent user and the MBTI classification label into a personality classification model based on an average binary cross-entropy objective function for classification processing, and output a final MBTI personality label of the silent user.
Citation Information
Patent Citations
User personality identification method based on online social network
CN114461758A
Network alignment method and system based on personality of social network users
CN115269845A