A suicide risk detection method based on social network media posting information
By analyzing public posts and hidden comments on social network media, using deep learning technology to capture the changes in users' inner thoughts and emotions, building a suicide risk detection model, solving the problem of neglecting real thoughts and feelings in the existing technology, and achieving high-accurate suicide risk detection.
Patent Information
- Application Number
- CN202110090702.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-22
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2041-01-22
AI Technical Summary
When detecting the risk of suicide, the existing technology ignores people's true thoughts and feelings in their hearts, and lacks methods with high detection accuracy.
By analyzing users' public posts and hidden comments in tree holes on social network media, using technical means such as the Bert model and GRU layer to capture the changes in users' inner thoughts and emotions, and construct a suicide risk detection model.
It realizes the user's hidden true thoughts and feelings from the public social network media information, improves the accuracy of suicide ideation detection, and can predict suicide risks in advance and intervene.
Smart Images

Figure CN112766747B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of natural language technology, and in particular to a suicide risk detection method based on social network media posting information. Background Art
[0002] Suicide has become a serious problem that harms the well-being of human society around the world. With the help of social media, the detection of suicide ideation from people's language posts has reached the most advanced level with an accuracy of 91%. Existing solutions in the past have a common problem: emphasizing people's external expressions on social media, while ignoring people's true inner thoughts and feelings. Obtaining and understanding people's hidden true thoughts and feelings from relevant social networks, and then detecting suicide ideation based on intermediate results can provide very high prediction accuracy for suicidal intentions, thereby intervening in advance and avoiding tragedies. In the prior art, although there have been relevant attempts, there is no specific and effective suicide risk detection method based on social network media posting information with high detection accuracy.
[0003] Purpose of the Invention
[0004] The purpose of the present invention is to solve the deficiencies in the prior art and provide a suicide risk method based on social network media posting information, which can understand people's hidden true thoughts and feelings from their public Weibo posts and other social network media, predict psychological stress, and then detect suicidal thoughts based on the intermediate results. Summary of the invention
[0005] The present invention provides a suicide risk detection method based on social network media posting information, comprising the following steps:
[0006] Step 1: Understand the correlation between the user's public posts on social networking media and their hidden comments in the tree hole, and gain insight into the user's true thoughts and emotional changes from the user's public posts; specifically, it includes the following sub-steps:
[0007] Sub-step S11: reveal the user's true thoughts based on the user's public posts on social networking media, let OP[1, t] = (O1, O2, ..., O t ) represents the sequence of public posts made by the user on social networking media from week 1 to week t, O i is the set of weekly posts published in the ith week, where 1≤i≤t; a user's public posts contain text sentences and visual images, and the user's weekly post set is represented as O i =(OS i , OP i ), where OS i It is a set of sentences, OP iis a set of pictures posted in week i; the hidden comments posted by users in the tree hole are represented as The hidden comment reflects the user's true inner thoughts; OP[1, t] and The following mapping function is satisfied:
[0008]
[0009] in, It is a vector representation similar to Bert, t is called the sliding window size of the mapping function, t = 26 weeks, z = 768;
[0010] Applying a sliding window of size t to the set of user public posts from week 1 to week n, Ouser[1,t],OP[2,t+1],...,OP[n-t+1,n], generates a series of hidden comments based on Bert: in,
[0011]
[0012] Among them, t = 26 weeks, n = 52 weeks, equivalent to 1 year;
[0013] Sub-step S12: Capturing the implicit emotional changes of users, first define the measurement of weekly emotions revealed from the user's weekly post set and the emotional changes between two consecutive weeks, and define the user's emotions into 7 categories: happiness, love, surprise, anger, sadness, anxiety, and disgust, expressed as:
[0014] EC={joy″, love, surprised, angry, sorry, anxiety, hate″}.
[0015] The Chinese emotion dictionary DUTIR was used to obtain a total of 27,466 words related to the seven categories of emotions. Each word was assigned an intensity score, where 9 represents the highest intensity and 1 represents the lowest intensity, i.e., EI = {1, 3, 5, 7, 9};
[0016] Assume that the function WordSet(c, i) returns the set of words of category c with strength score i in the DUTIR dictionary, where (c∈EC), (i∈EI);
[0017] Let S denote a set of language sentences posted by a user in a certain week, that is, S is the set of sentences posted publicly by the user on social networking media or the set of hidden comments posted in the tree hole, then: The emotional degree value of category c∈EC revealed from S is the total emotional intensity of the words in the emotional category c, expressed as:
[0018]
[0019]
[0020] Among them, all intensity values are normalized. represents the maximum emotional intensity of all publicly posted sentences with emotional category c, where 0≤e(S, c)≤1;
[0021] The emotional levels of the seven emotional categories represented by S are presented in a 7-dimensional vector, expressed as:
[0022]
[0023] Among them, c i ∈EC, calculates the change in sentiment between two consecutive weeks based on the sentiment level presented in the sentence set of Zhou Gong’s posts;
[0024] Let S k With S k+1 is the set of publicly posted sentences in the kth week and the (k+1)th week, then S k With S k+1 The mood changes between are defined as:
[0025]
[0026] Among them, 1≤k≤n-1, c i ∈EC;
[0027] According to the user's public post sentence sequence in week t (OS1, OS2, ..., OS t ), derive the user’s emotion change sequence from week 1 to week t:
[0028]
[0029] By changing the user's external emotional sequence Mapped to an internal real emotional change sequence Among them, 1≤m≤t, which simulates the emotional change sequence reflected by the user's hidden comments from the mth to the tth week in the tree hole, as shown in the following mapping function:
[0030]
[0031] Applying a sliding window of size t and a sliding step of 3 to the sequence OE[1, t], OE[4, t+3], ..., OE[n-t+1, n] produces the following sequence:
[0032] CE[m,t], CE[t,t+(tm)],…, CE[n-(tm),n],
[0033] in Here, t = 26 weeks, m = 23 weeks, n = 52 weeks;
[0034] Step 2: Build a model to detect suicide risk based on the user’s inner thoughts from week t to week n. The obtained emotion change sequence CE[m, t], CE[t, t+(tm)], ..., CE[n-(tm), n] from the mth week to the nth week is combined with the characteristics of the social network media used to detect the suicide risk coefficient.
[0035] Preferably, in step 1, sub-step S11 is implemented by constructing model A, which specifically includes the following three steps:
[0036] Step 1: Learn to represent the user's weekly social network media posting sentence set O = (OS, OP), use known suicide-oriented words or word embeddings, and use a 300-dimensional vector to represent the posting sentence set O = (OS, OP). The OS is converted into a k×300 matrix as shown below:
[0037]
[0038] Where k is the total number of words or phrases in OS, is the word embedding of the i-th word in OS, 1≤i≤m; the collection of sentences posted on social network media in one week OS e The embedding vector representation of is passed through a GRU layer to obtain the basic text about OS, which is expressed as:
[0039] h l =GRU1(x l ,h l-1 ),
[0040] Among them, h l-1 With h l They are the hidden states of the (l-1)th and lth positions respectively (1≤l≤m);
[0041] make Through the attention mechanism, the attention vector related to the user's internal thoughts in H is obtained as follows:
[0042]
[0043] Among them, Att is the attention vector, which shows the distribution of the weight of each word in the basic text representation OS. and is the training parameter;
[0044] The multiplication of the attention vector Att and H generates the final sentence of OS, which is expressed as:
[0045]
[0046] The pictures in the user's weekly social network media posts are represented as a picture set OP. A 34-layer ResNet is used to extract a (300×1)-dimensional visual feature representation, and the average feature vector of all pictures in OP is used as the visual picture representation of each week. if A default image is used, and this image is displayed in the image position required by the application;
[0047] Through the merge operation Merging language-level representations Visual picture level representation The language picture representation O=(OS, OP) of the weekly social network media posts is obtained as follows:
[0048]
[0049] Step 2: Learn to represent the user’s social network media posting set from week 1 to week t (O 1, O2, ..., O t ), specifically:
[0050] Taking t as the sliding window, for the user's weekly public post set sequence (O1, O2, ..., O t ), obtain the corresponding language-level representation and visual picture-level representation sequence Will Input a GRU layer and an attention layer as follows:
[0051]
[0052] Among them, h l-1 With h l They are the hidden states of the (l-1)th and lth positions respectively (1≤l≤t);
[0053] make Applying the second attention layer to H′, we can get clues from the social network media posts in week t, expressed as follows:
[0054]
[0055] Among them, Att′ represents the different contribution weights of clues appearing in different weeks, and is the training parameter;
[0056] Based on the attention vector Att′, we obtain the user’s public social network media posting set from week 1 to week t, expressed as
[0057]
[0058] in, and is the training parameter;
[0059] Step 3: Represent the sequence (O1, O2, ..., O3) of the social network media posts of user t week. t ), generate a virtual sentence; through a fully connected layer, derive a hidden comment based on Bert, expressed as As shown below:
[0060]
[0061] in, and is the training parameter;
[0062] The training of model A is based on Bert's comments With actual comments The cosine loss function between is expressed as:
[0063]
[0064] Preferably, sub-step S12 is implemented by constructing a training model B, using a neural encoding and decoding method to encode the input open emotion change sequence OE[1, t] into an intermediate internal vector representation, and then decode the internal representation to generate a hidden emotion change sequence CE[m, t], specifically including the following two steps:
[0065] Step 1: Encode OE[1, t] into an internal representation Specifically, the input emotion change sequence is represented as OE[1, t]-(oe 1,2 ,oe 2,3 ,…,oe t-1,t ), which is input into a GRU layer GRU3, expressed as:
[0066]
[0067] in, is the input and output state of the encoder at the lth position, is the implicit state of the (l-1)th and lth positions (1≤l≤t);
[0068] Initially, h 0,1 =(0, 0, ..., 0), and through CRU3 encoding, the internal sequence of OE[1, t] is obtained, which is expressed as follows:
[0069]
[0070] Step 2: Decoded into the output sequence CE[m, t], specifically, in the last hidden state h of the encoder t-1,t Based on this, another GRU layer GRU4 with an attention mechanism is used to Decode and generate the output sequence CE[m, t], expressed as (ce m,m+1 ,ce m+1,m+2 ,…,ce t-1,t ), 1≤m≤t-1, as shown in the following formula:
[0071]
[0072]
[0073] (ce l,l+1 , h′ l,l+1 )=GRU4(in l,l+1 ,h l-1,l ),
[0074] in, is the hidden state of the (l-1)th and lth positions of GRU4, is the input and output state of the lth position, is the learned attention vector, as well as is the training parameter (1≤m≤t-1), input value in l,l+1 is based on the previous output, the previous hidden state value, and the (t-1)-dimensional encoder output The relevant attention vector is calculated;
[0075] Initially, l = m, and the decoder's h' m-1,m Set to the last hidden state of the encoder, i.e. h′ m-1,m =h t-1,t , let the decoder's ce m-1,m is (0, 0, ..., 0), then the following relationship is satisfied:
[0076]
[0077] After GRU4, the user's intrinsic emotion change sequence from week m to week t is derived
[0078] CE[m, t] = (ce m,m+1 ,ce m+1,m+2 ,…,ce l-1,l), where 1≤m≤t-1;
[0079] The constructed training model B adopts the MSE-based loss function. As the loss function value decreases, the generated internal emotion change sequence CE[m, t] continues to approach the true value CE[m, t] a , as shown below:
[0080]
[0081] Preferably, and Applied to two derivative sequences, extracting key clues related to suicidal ideation respectively, and is the final output of GRU5 and GRU6, which respectively represent the hidden comment representation of the 52nd week and the change in user sentiment between the 51st week and the 52nd week;
[0082] The user's personal profile information, including gender, username length, number of posts, posting time distribution, number of followers, and number of users followed, is included in the suicide risk analysis, and the user's profile is represented by a 12-dimensional vector;
[0083] Through splicing operation Out a ,out b Combined with the profile, we get the final representation U of a user, as shown below:
[0084]
[0085] Through a fully connected layer, we can determine whether a user has the possibility of suicide risk, as shown below:
[0086]
[0087] Among them, 0≤y1, y0≤1, y1, y0 respectively represent the probability of the user having or not having suicide risk, and is the training parameter.
[0088] Preferably, the social network media includes Weibo, WeChat, Twitter, and Facebook. BRIEF DESCRIPTION OF THE DRAWINGS
[0089] Figure 1 Schematic diagram of the suicide risk detection method of the present invention.
[0090] Figure 2 This is a model diagram proposed by the present invention for learning a user's true thoughts from his / her public social network media.
[0091] Figure 3 This is a model diagram proposed by the present invention for inferring the user's real emotional fluctuations based on the user's public emotional fluctuations.
[0092] Figure 4 The present invention proposes a fusion Figure 2 and Figure 3 Model diagram for suicide risk detection. DETAILED DESCRIPTION
[0093] The present invention is described in detail below with reference to the accompanying drawings.
[0094] The present invention is explained by taking Weibo posting as an example. First, the correlation between the user's normal posts and the hidden comments in the tree hole is understood, and the user's true thoughts and emotional changes are understood from the user's public posts; then, the user's suicide risk is detected based on this. Figure 1 The suicide risk detection diagram of the present invention is given, which is divided into three subtasks.
[0095] Subtask 1: Reveal the user’s true inner thoughts from their public Weibo posts.
[0096] The set of public posts of a user from week 1 to week t is represented as OP[1, t] = (O1, O2, ..., O t ). Subtask 1 aims to derive the hidden comments of the user in week t Right now
[0097] A GRU layer, a ResNet layer, and a fully connected layer are used to encode the user’s text and pictures respectively.
[0098] The attention mechanism is introduced to find key content related to the hidden comments in the tree hole. Model A of subtask 1 aims to discover the implicit association between users' public posts and hidden comments in the tree hole at the content level.
[0099] Subtask 2: Capturing users’ implicit emotional changes
[0100] Subtask 2 aims to capture the correlation between users’ public posts and hidden comments from the emotional level. Here, we consider the main emotions (happiness, love, surprise, anger, sadness, anxiety, disgust).
[0101] Assume that S represents a set of public microblog sentences or a set of hidden comments in a tree hole. e(S, c) represents the emotional level value of the emotional category c revealed by S. The emotional levels of the seven emotional categories revealed by S can be expressed as E(S). k+1 )-E(S k ) to measure changes in mood between consecutive weeks.
[0102] Let OE[1, t] represent the sequence of sentiment changes from week 1 to week t shown in the user's publicly published Weibo posts. Subtask 2 requires inferring the sequence of sentiment changes from week m to week t revealed by the hidden comments in the tree hole. here, represents the change in mood from week (l-1) to week l (m+1≤l≤t), that is,
[0103] The present invention adopts a seq2seq model to generate a series of hidden emotion change sequences according to the public emotion change sequences.
[0104] Subtask 3: Integrate the above two models to detect suicide risk
[0105] Based on the above two models (Model A and Model B), the present invention designs a technology for detecting an individual's true suicidal thoughts. The pre-trained Model A is used multiple times to obtain the user's inner thoughts from week t to week n: (C t , C t+1 , ..., C n ).
[0106] Similarly, the pre-trained model B is used multiple times to derive the user's emotion change sequence from week m to week n:
[0107] (CE[m,t],CE[t,t+(tm)],...,CE[n-(tm),n]=(ce m,m+1 ,ce m+1,m+2 ,...,ce n-1,n ).
[0108] The goal of subtask 3 is to integrate the above two results and consider the user’s social media characteristics to detect their suicide risk.
[0109] The three subtask models are introduced in detail below.
[0110] 1. Capture the user’s true thoughts from their public Weibo posts (Subtask 1)
[0111] 1.1 Task A
[0112] Since there is a correlation between users’ negative emotional expressions in open Weibo and hidden Weibo posts, the goal of Subtask 1 is to discover users’ true thoughts from open Weibo posts.
[0113] Let OP[1,t]=(O1,O2,...,O t ) represents the user’s public microblog post sequence from week 1 to week t, O iis the weekly post set published in the ith week (1≤i≤t). Since a user’s post may contain text sentences and visual images, the weekly post set of the user is O i =(OS i , OP i ), where OS i It is a set of sentences, OP i is a set of pictures published in week i. Subtask 1 aims to infer the hidden comments posted by a user in the tree hole based on the weekly Weibo post sequence OF[1, t] publicly released by the user from week 1 to week t These hidden comments reflect the user’s true inner thoughts. Subtask 1 can be expressed as the following mapping function:
[0114]
[0115] Its in, It is a vector representation similar to Bert, t is called the sliding window size of the mapping function, here, t = 26 weeks, z = 768.
[0116] Apply a sliding window of size t to the user's public microblog post set OP[1, t], OP[2, t+1], ..., OP[n-t+1, n] from week 1 to week n. Subtask 1 generates a series of Bert-based hidden comments in,
[0117] Here, t = 26 weeks, n = 52 weeks (equivalent to 1 year).
[0118] 1.2 Model A
[0119] From the user's weekly public post set sequence, learning hidden comments is done in three steps, such as Figure 2 shown.
[0120] Step 1: Learn to represent the user's weekly microblog post set O = (OS, OP)
[0121] Language-level representation
[0122] For each language word in the weekly post sentence set OS, a 300-dimensional vector is used to represent it through the suicide-oriented word embedding in the literature. OS can therefore be converted into a (k×300) matrix:-
[0123]
[0124] Where k is the total number of words in OS, is the word embedding of the i-th word in OS (1≤i≤m).
[0125] Weekly Sentences Collection OSc The embedding vector representation of is passed through a GRU layer to obtain the basic text representation of OS:
[0126] h l =GRU1(x l ,h t-1 ),
[0127] Among them, h l-1 With h l They are the hidden states of the (l-1)th and lth positions respectively (1≤l≤m).
[0128] make Through the attention mechanism, key clues related to the user’s inner thoughts are obtained in H:
[0129]
[0130] Among them, Att is the attention vector, which shows the distribution of the weight of each word in the basic text representation OS. and is the training parameter.
[0131] The multiplication of the attention vector Att and H generates the final sentence representation of the weekly sentence set OS:
[0132]
[0133] Visual picture-level representation
[0134] For the weekly Weibo picture collection OP, a 34-layer ResNet is used to extract a (300×1)-dimensional visual feature representation. The average feature vector of all pictures in OP is used as the visual picture representation of each week. if Use a default image that is usually displayed where an application requires an image.
[0135] Merging language-level representations with visual image-level representations
[0136] Through the merge operation Merging language-level representations Visual picture level representation Get the language picture representation of Zhou Weibo O = (OS, OP):
[0137]
[0138] Step 2: Learn to represent the set of microblog posts (O1, O2, ..., O t )
[0139] Taking t as the sliding window, for the user's weekly public post set sequence (O1, O2, ..., O t ), we can obtain the corresponding language-level representation and visual picture-level representation sequence In order to further find key clues from the Weibo posts in week t, Input a GRU layer and an attention layer:
[0140]
[0141] Among them, h l-1 With h l They are the hidden states of the (l-1)th and lth positions respectively (1≤l≤t).
[0142] make Apply a second attention layer to H′ to get clues from Weibo posts in week t:
[0143]
[0144] Among them, Att′ represents the different contribution weights of clues appearing in different weeks, and is the training parameter.
[0145] Then, based on the attention vector Att′, the user’s public Weibo post set from week 1 to week t is obtained.
[0146]
[0147] in, and is the training parameter.
[0148] Step 3: Represent the sequence (O1, O2, ..., O3) from the set of microblog posts of user t week. t ), generate a virtual sentence
[0149] Finally, through a fully connected layer, a Bert-based hidden comment representation is derived
[0150]
[0151] in, and is the training parameter.
[0152] The training of the above model is based on Bert's comments With actual comments The cosine loss function between:
[0153]
[0154] As the loss function value decreases, the similarity between the two values becomes closer.
[0155] 2. Capturing the user’s true emotional changes (Subtask 2)
[0156] 2.1 Objective B
[0157] Subtask 1 aims to learn and understand the correlation between users’ public Weibo posts and their true hidden thoughts from the content level, while Subtask 2 aims to understand users’ true inner emotions from the emotions shown in their public Weibo posts.
[0158] There are two difficulties in directly capturing users’ real feelings based on their public Weibo posts. First, due to the free nature of social media, users’ language expressions on social media are usually implicit and uncertain. Second, some emotions (e.g., joy, love, surprise, anger, sadness, anxiety, hatred) may be intertwined from users’ public posts.
[0159] Preventing users from understanding their true inner emotions. To solve this problem, we focus on the emotional changes revealed by users’ public Weibo posts and use these changes to perceive users’ suicide risks.
[0160] Before giving a formal definition of subtask 2, we first define the measurement of weekly sentiment revealed from a user's weekly post set and the change in sentiment between two consecutive weeks. Consider the following seven categories of sentiment:
[0161] EC={joy″, love, surprised, angry, sorry, anxiety, hate″}.
[0162] In order to measure the intensity of different categories of emotions, the Chinese emotion dictionary DUTIR is used, which contains a total of 27,466 words related to these 7 categories of emotions. Each word in the emotion category has an intensity score, where 9 represents the highest intensity and 1 represents the lowest intensity, that is, EI = {1, 3, 57, 9}. Assume that the function WordSet(c, i) returns the set of words of category c with intensity score i in the DUTIR dictionary, where (c∈EC) and (i∈EI).
[0163] Let S denote a set of language sentences published in a certain week. In the following definition, S is a set of public Weibo sentences or a set of hidden comments published in the tree hole.
[0164] Definition 1: The category revealed from S is The emotional degree value of is the total emotional intensity of the words in emotional category c, expressed as:
[0165]
[0166]
[0167] Here, all intensity values are normalized. Represents the maximum emotional intensity of all public microblog sentences with emotional category c (0≤e(S,c)≤1).
[0168] Definition 2: The emotional levels of the seven emotional categories revealed by S can be presented in a 7-dimensional vector
[0169]
[0170] Among them, (c i ∈EC).
[0171] Based on the definition of the emotional level presented in the weekly Weibo sentence set, the emotional changes between two consecutive weeks can be calculated.
[0172] Definition 3: Let S k With S k+1 S is the set of microblog sentences in the kth week and the (k+1)th week. k With S k+1 The mood changes between are defined as:
[0173]
[0174] Among them, (1≤k≤n-1), (c i ∈EC).
[0175] According to the above definition, from the microblog sentence set sequence (OS1, OS2, ..., OS t ), we can derive the user’s emotion change sequence from week 1 to week t:
[0176]
[0177] The purpose of subtask 2 is to sequence the user's external emotional changes Mapped to an internal real emotional change sequence This simulates the emotional change sequence reflected by the user's hidden comments from the mth to the tth week in the tree hole, which is represented by the following mapping function:
[0178]
[0179] Pair Sequence Applying a sliding window of size t and a sliding stride of 3 weeks, subtask 2 produces the corresponding sequence:
[0180] CE[m,t],CE[t,t+(tm)],…,CE[n-(tm),n]
[0181] in,
[0182]
[0183]
[0184]
[0185] Here, t = 26 weeks, m = 23 weeks, and n = 52 weeks (1 year).
[0186] 2.2 Model B
[0187] Subtask 2 can be converted into a sequence-to-sequence (seq2seq) task. A neural encoding and decoding method is used. The input open emotion change sequence OE[1, t] is encoded into an intermediate internal vector representation, and then the internal representation is decoded to generate a hidden emotion change sequence
[0188] Figure 3 The encoder and decoder of model B.
[0189] Step 1: Encode OE[1, t] into an internal representation
[0190] For ease of explanation, the input emotion change sequence is represented as OE[1, t] = (oe 1,2 ,oe 2,3 ,…,os t-1,t ). To encode this input sequence into an internal representation, it is fed into a GRU layer GRU3:
[0191]
[0192] in, is the input and output state of the encoder at the lth position, is the implicit state of the (l-1)th and lth positions (1≤i≤t). Initially, h 0,1 =(0, 0,…, 0).
[0193] Through GRU3 encoding, we get The internal sequence is:
[0194]
[0195] Step 2: Decoded into the output sequence CE[m, l]
[0196] In the last hidden state h of the encoder t-1,tBased on this, another GRU layer GRU4 with an attention mechanism is used to represent the internal Decode and generate the output sequence CE[m, t], expressed as
[0197] (ce m,m+1 ,ce m+1,m+2 ,…,ce t-1,t )(1≤m≤t-1):
[0198]
[0199]
[0200] (ce l,l+1 , h′ l,l+1 )=GPU4(in l,l+1 , h′ l-1,l )
[0201] in, is the hidden state of the (l-1)th and lth positions of GRU4, is the input and output state of the lth position, is the learned attention vector, as well as is a training parameter (1≤m≤t-1).
[0202] Input value in l,l+1 is based on the previous output, the previous hidden state value, and the (t-1)-dimensional encoder output The relevant attention vector is calculated.
[0203] Initially, (l = m). h' of the decoder m-1,m Set to the last hidden state of the above encoder, that is, (h′ m-1,m =h t-1,t ). Let the decoder's ce m-1,m is (0, 0,…, 0).
[0204]
[0205] After GRU4, derive the user's intrinsic emotion change sequence from week m to week t
[0206] CE[m, t] = (ce m,m+1 ,ce m+1,m+2 ,…,ce t-1,t )(1≤m≤l-1).
[0207] The MSE-based loss function is used to train model B. As the loss function value decreases, the generated internal emotion change sequence CE[m, t] continues to approach the true value CE[m, t] a :
[0208]
[0209] 3. Integrate two models to detect suicide risk (subtask 3)
[0210] 3.1 Objective C
[0211] Model A and Model B enable capturing the associations between public Weibo posts and hidden comments in the tree hole at both the content and sentiment levels.
[0212] Use the pre-trained model A to infer the user’s inner thoughts from week t to week n:
[0213]
[0214] Similarly, use the pre-trained model B to derive the user's emotion change sequence from week m to week n:
[0215] (CE[m,t],CE[t,t+(tm)],…,CE[n-(tm),n])=(ce m,m+1 ,ce m+1,m+2 ,…,ce n-1,n )
[0216] The goal of subtask 3 is to combine the above two types of results and consider the user’s social media characteristics to perform suicide risk detection.
[0217] 3.2 Model C
[0218] like Figure 4 As shown, and Applied to two derivative sequences, aiming to extract key clues related to suicidal ideation respectively. and for and The final output of . They each represent the hidden comment representation of the 52nd week and the change in user sentiment between the 51st week and the 52nd week.
[0219] In addition to understanding the user's hidden thoughts and emotional changes, the user's personal profile information, including gender, username length, number of posts, posting time distribution, number of followers, number of users followed, etc., is also included in the suicide risk analysis. The user's profile is represented by a 12-dimensional vector.
[0220] Through splicing operation Out a ,out b Combined with the profile, we can get the final representation U of a user:
[0221]
[0222] Finally, through a fully connected layer, we can determine whether a user has the possibility of suicide risk:
[0223]
[0224] Among them, y1, y0 (0≤y1, y0≤1) represent the possibility that the user has (or does not have) suicide risk. and is the training parameter.
Claims
1. A suicide risk detection method based on social network media posting information, characterized in that: The following steps are involved: Step 1: Understand the correlation between the user's public posts on social networking media and their hidden comments in the tree hole, and gain insight into the user's true thoughts and emotional changes from the user's public posts; specifically, it includes the following sub-steps: Sub-step S11: reveal the user's true thoughts based on the user's public posts on social networking media, let OP[1, t] = (O1, O2, ..., O t ) represents the sequence of public posts made by the user on social networking media from week 1 to week t, O i is the set of weekly posts published in the ith week, where 1≤i≤t; a user's public posts contain text sentences and visual images, and the user's weekly post set is represented as O i =(OS i , OP i ), where OS i It is a set of sentences, OP i is a set of pictures posted in week i; the hidden comments posted by users in the tree hole are represented as The hidden comment reflects the user's true inner thoughts; OP[1, t] and The following mapping function is satisfied: in, It is a vector representation similar to Bert, t is called the sliding window size of the mapping function, t = 26 weeks, z = 768; Applying a sliding window of size t to the user's public post set OP[1, t], OP[2, t+1], ..., OP[n-t+1, n] from week 1 to week n generates a series of hidden comments based on BERT. in, Among them, t = 26 weeks, n = 52 weeks, equivalent to 1 year; Sub-step S12: Capturing the implicit emotional changes of users, first define the measurement of weekly emotions revealed from the user's weekly post set and the emotional changes between two consecutive weeks, and define the user's emotions into 7 categories: happiness, love, surprise, anger, sadness, anxiety, and disgust, expressed as: EC={joy″,love,surprised,angry,sorrow,anxiety,hate”}. The Chinese emotion dictionary DUTIR was used to obtain a total of 27,466 words related to the seven categories of emotions. Each word was assigned an intensity score, where 9 represents the highest intensity and 1 represents the lowest intensity, i.e., EI = {1, 3, 5, 7, 9}; Assume that the function WordSet(c, i) returns the set of words of category c with strength score i in the DUTIR dictionary, where (c∈EC), (i∈EI); Let S denote a set of language sentences posted by a user in a certain week, that is, S is the set of sentences posted publicly by the user on social networking media or the set of hidden comments posted in the tree hole. Then, the emotional degree value of category c∈EC revealed from S is the total emotional intensity of the words in the emotional category c, expressed as: Among them, all intensity values are normalized. represents the maximum emotional intensity of all publicly posted sentences with emotional category c, where 0≤e(S, c)≤1; The emotional levels of the seven emotional categories represented by S are presented in a 7-dimensional vector, expressed as: Among them, c i ∈EC, calculates the change in sentiment between two consecutive weeks based on the sentiment level presented in the sentence set of Zhou Gong’s posts; Let S k With S k+1 is the set of publicly posted sentences in the kth week and the (k+1)th week, then S k With S k+1 The mood changes between are defined as: Among them, 1≤k≤n-1, c i ∈EC; According to the user's public post sentence sequence in week t (OS1, OS2, ..., OS t ), derive the user’s emotion change sequence from week 1 to week t: By changing the user's external emotional sequence Mapped to an internal real emotional change sequence Among them, 1≤m≤t, which simulates the emotional change sequence reflected by the user's hidden comments from the mth to the tth week in the tree hole, as shown in the following mapping function: Applying a sliding window of size t and a sliding step of 3 to the sequence OE[1, t], OE[4, t+3], ..., OE[n-t+1, n] produces the following sequence: CE[m,t], CE[t,t+(tm)],…, CE[n-(tm),n], in Here, t = 26 weeks, m = 23 weeks, n = 52 weeks; In step 1, sub-step S11 is implemented by constructing model A, which specifically includes the following three steps: Step 1: Learn to represent the user's weekly social network media posting sentence set O = (OS, OP), use known suicide-oriented words or word embeddings, and use a 300-dimensional vector to represent the posting sentence set O = (OS, OP). The OS is converted into a k×300 matrix as shown below: Where k is the total number of words or phrases in OS, is the word embedding of the i-th word in OS, 1≤i≤m; the collection of sentences posted on social network media in one week OS e The embedding vector representation of is passed through a GRU layer to obtain the basic text about OS, which is expressed as: h l =GRU1(x l ,h l-1 ), Among them, h l-1 With h l They are the hidden states of the (l-1)th and lth positions respectively (1≤l≤m); make Through the attention mechanism, the attention vector related to the user's internal thoughts in H is obtained as follows: Among them, Att is the attention vector, which shows the distribution of the weight of each word in the basic text representation OS. and is the training parameter; The multiplication of the attention vector Att and H generates the final sentence of OS, which is expressed as: The pictures in the user's weekly social network media posts are represented as a picture set OP. A 34-layer ResNet is used to extract a (300×1)-dimensional visual feature representation, and the average feature vector of all pictures in OP is used as the visual picture representation of each week. if A default image is used, and this image is displayed in the image position required by the application; Through the merge operation Merging language-level representations Visual picture level representation The language picture representation O=(OS, OP) of the weekly social network media posts is obtained as follows: Step 2: Learn to represent the user’s social network media posting set (O1, O2, ..., O t ), specifically: Taking t as the sliding window, for the user's weekly public post set sequence (O1, O2, ..., O t ), obtain the corresponding language-level representation and visual picture-level representation sequence Will Input a GRU layer and an attention layer as follows: Among them, h l-1 With h l They are the hidden states of the (l-1)th and lth positions respectively (1≤l≤t); make Applying the second attention layer to H′, we can get clues from the social network media posts in week t, expressed as follows: Among them, Att' represents the different contribution weights of clues appearing in different weeks, and is the training parameter; Based on the attention vector Att', we obtain the user's public social network media posting set from week 1 to week t, expressed as in, and is the training parameter; Step 3: Represent the sequence (O1, O2, ..., O3) of the social network media posts of user t week. t ), generate a virtual sentence; through a fully connected layer, derive a hidden comment based on Bert, expressed as As shown below: in, and is the training parameter; The training of model A is based on Bert's comments With actual comments The cosine loss function between is expressed as: Sub-step S12 is implemented by constructing a training model B. A neural encoding and decoding method is used to encode the input open emotion change sequence OE[1, t] into an intermediate internal vector representation, and then the internal representation is decoded to generate a hidden emotion change sequence CE[m, t]. Specifically, the following two steps are included: Step 1: Encode OE[1, t] into an internal representation Specifically, the input emotion change sequence is represented as OE[1, t] = (oe 1,2 ,oe 2,3 ,…,oe t-1,t ), which is input into a GRU layer GRU3, expressed as: in, is the input and output status of the encoder's first position, is the implicit state of the (l-1)th and lth positions (1≤l≤t); Initially, h 0,1 =(0, 0, ..., 0), and through GRU3 encoding, the internal sequence of OE[1, t] is obtained, which is expressed as follows: Step 2: Decoded into the output sequence CE[m, t], specifically, in the last hidden state h of the encoder t-1,t Based on this, another GRU layer GRU4 with an attention mechanism is used to represent the internal Decode and generate the output sequence CE[m,r], expressed as (ce m,m+1 ,ce m+1,m+2 ,…,ce t-1,t ), 1≤m≤t-1, as shown in the following formula: (ce l,l+1 ,h l,l+1 )=GRU4(in l,l+1 ,h l-1,l ), in, is the hidden state of the (l-1)th and lth positions of GRU4, is the input and output state of the lth position, is the learned attention vector, as well as is the training parameter (1≤m≤t-1), input value in l,l+1 is based on the previous output, the previous hidden state value, and the (t-1)-dimensional encoder output The relevant attention vector is calculated; Initially, l = m, and the decoder's h' m-1,m Set to the last hidden state of the encoder, i.e. h′ m-1,m =h t-1,t , let the decoder's ce m-1,m is (0, 0, ..., 0), then the following relationship is satisfied: After GRU4, the user’s intrinsic emotion change sequence CE[m, t] = (ce m,m+1 ,ce m+1,m+2 ,…,ce t-1,t ), where 1≤m≤t-1; The constructed training model B adopts the MSE-based loss function. As the loss function value decreases, the generated internal emotion change sequence CE[m, t] continues to approach the true value CE[m, t] a , as shown below: Step 2: Build a model to detect suicide risk based on the user’s inner thoughts from week t to week n. The obtained emotion change sequence CE[m, t], CE[t, t+(tm)], ..., CE[n-(tm, n] from week m to week n is combined with the characteristics of the social network media used to detect the suicide risk coefficient; In step 2, GRU5 and GRU6 are applied to two derivative sequences to extract key clues related to suicidal ideation, respectively. and is the final output of GRU5 and GRU6, which respectively represent the hidden comment representation of the 52nd week and the change in user sentiment between the 51st week and the 52nd week; The user's personal profile information, including gender, username length, number of posts, posting time distribution, number of followers, and number of users followed, is included in the suicide risk analysis, and the user's profile is represented by a 12-dimensional vector; Through splicing operation Out a ,out b Combined with the profile, we get the final representation U of a user, as shown below: Through a fully connected layer, we can determine whether a user has the possibility of suicide risk, as shown below: [y1, y0]=Softmax(U×W8+b8), Among them, 0≤y1, y0≤1, y1, y0 respectively represent the probability of the user having or not having suicide risk, and is the training parameter.
2. A suicide risk detection method based on social network media posting information according to claim 1, characterized in that: The social networking media include Weibo, WeChat, Twitter, and Facebook.
Citation Information
Patent Citations
Microblog user suicide risk detection method and device
CN110489552A
Emotion analysis method, device and system based on user diaries
CN111326222A