Elamur Research

Automatic Detection and Classification of Mental Illnesses from General Social Media Texts

Paper · 2021 · Anca Dinu and Andreea-Codrina Moldovan

Summary

A discussion about a recipe, a hobby, or a relationship can reveal something about its writer even when mental health is absent from the topic. Anca Dinu and Andreea-Codrina Moldovan ask how much of that information can be recovered automatically from a single Reddit post. Their study uses text classification to distinguish posts by accounts associated with self-reported diagnoses from posts by comparison accounts. The author supplies the dataset label, and the post supplies the evidence available to the classifier. This arrangement lets the researchers test ordinary discussion without requiring a collection of posts from each account at prediction time.

The experiments use SMHD, a Reddit dataset that uses self-reports from support communities to identify diagnostic groups and gathers the text for classification from general discussions. The authors sample 50,000 posts per group and set up a separate binary task for each of the 9 conditions. Each task asks whether a post came from the group associated with that condition or from the control group. They adapt BERT, RoBERTa, and XLNet to these tasks and use a separate word analysis to see which vocabulary distinguishes each pair of groups.

The results vary across conditions. In the paper’s comparative F1 table, where F1 balances the ability to find labeled cases with the ability to avoid incorrect positive predictions, the strongest result is 0.81 for eating disorders with BERT. The best reported depression result is 0.70 with XLNet, the lowest of the best scores across conditions. The paper’s BERT scores exceed the earlier single-post scores from Jiang and colleagues wherever the comparison is available. Scores also exceed the earlier SMHD figures selected by the authors, although those comparisons bring together results from separate studies. Vocabulary connected to food and diet stands out in the eating-disorder analysis. The authors suggest that depression may be harder to distinguish because whether people express their emotional state depends on the circumstances in which they write.

The experiment shows that one post can carry enough information to predict its author’s dataset group with measurable success. The score concerns agreement with labels derived from Reddit activity and self-reports. Clinical diagnosis, performance on accounts entirely unseen during training, and detection before a diagnosis each require evidence beyond the reported post-level results.

Deep dive: Automatic Detection and Classification of Mental Illnesses from General Social Media Texts

How Dinu and Moldovan used individual Reddit posts to distinguish mental health groups, and what their SMHD classification results establish. · about 31 minutes to read

The problem and its context

Why look outside support communities?

A mental health support forum gives researchers a direct way to find people discussing a condition. It also gives a classifier clues about the reason a message was written. Someone may describe a diagnosis, ask about a treatment, or respond to another person’s account of symptoms. Being able to recognize posts of that kind is a different achievement from recognizing language associated with the same group when people are discussing something else. Dinu and Moldovan set out to examine the latter task.

The motivation combines a concern about access to care with a question about how people express themselves. The authors cite an estimate that roughly 10% of the world’s population lives with a mental illness. They also cite an estimate of more than 264 million people affected by depression in their discussion of the global burden. These figures explain the interest in studying mental health at scale. They describe populations discussed in the cited research and give no estimate of the prevalence of any condition among the Reddit accounts in the experiment.

The paper treats barriers to discussing mental health as one reason to look at language beyond discussions explicitly organized around it. People may avoid speaking about personal difficulties because they anticipate stigma. Limited access to professional help is another part of the authors’ motivation. Their introduction also observes that places where help is difficult to obtain may have little data or limited access to the services a digital approach would depend on. The supervised experiment therefore begins with a narrower question than the public-health motivation might suggest. It asks which distinctions can be made from an existing collection of writing.

Support-community participation also affects who can be studied. The authors argue that people who ask for help in those spaces represent a distinctive part of the broader population living with mental illness. SMHD makes it possible to move the text analysis out of those communities while retaining a way to identify a group for research. The people with labels still enter the dataset through self-disclosure. The design changes the setting in which their writing is observed, while the initial opportunity to observe them still depends on what they chose to disclose.

That distinction matters because a classifier can succeed for several reasons. It could pick up how a subject is discussed, differences in which subjects are discussed, or vocabulary particular to the Reddit communities an account frequents. A discussion can be general in the sense that it takes place outside a forum for a diagnosis and still contain subjects related to that diagnosis. The eating-disorder results later illustrate how ordinary topical vocabulary can remain informative after the sources of text have been restricted.

From word categories to contextual representations

The paper places its work in an area shared by psychiatry, natural language processing, and machine learning. One line of work it describes uses Linguistic Inquiry and Word Count, or LIWC. LIWC groups words into categories so that researchers can compare patterns such as the use of pronouns, tense, emotion words, and words about personal concerns. A count for a category summarizes a kind of language use that might be spread across many different word forms.

Dinu and Moldovan describe the quantitative work of Pennebaker and colleagues as an important example of relating such linguistic categories to psychological dimensions. They mention subsequent applications to personality traits and to changes in the risk of self-harm in online settings. These studies help explain why variation in everyday written language is of scientific interest. The relevance to the Reddit experiment is methodological. If language differs systematically between groups, both broad categories and individual words offer ways to inspect those differences.

The authors also describe studies that focus on a single condition, citing work on depression and schizophrenia as examples. A single-condition design makes it possible to concentrate on one case definition and one comparison group. It leaves open whether the same approach would be equally informative for another condition. Using SMHD gives Dinu and Moldovan several such contrasts within a common dataset. They can look for differences in how readily the conditions are distinguished from controls without having to assemble a new corpus for each question.

Topic is a separate choice from the number of conditions. In the authors’ account, studies by Kim and colleagues and by Thorstad and Wolff use writing that discusses the conditions of interest. That setting gives a method access to fairly direct linguistic evidence. Cohan and colleagues and Jiang and colleagues are the main precedents the paper identifies for studying general Reddit discussions contributed by people who self-reported diagnoses. The new experiments pursue the general-discussion task and change the classification procedure used on that text.

For the learned classifiers, the paper draws on the Transformer architecture. Its relevance is the ability to represent a word in relation to other words around it. A word count can tell a researcher that a term appears. A contextual representation can vary with the text surrounding that term. Dinu and Moldovan point to prior adaptation of pretrained systems for tasks including question answering and text generation, as well as classification. Their rationale is that a general text representation can be adapted to a specific label distinction with examples of that distinction. Attention Is All You Need

The distinction between the two kinds of analysis remains important throughout the paper. A vocabulary ranking gives readers specific words they can inspect. A contextual classifier is evaluated by the labels it assigns to unseen test posts under the reported split. The words in the ranking can suggest explanations for a result. The prediction scores, by themselves, do not reveal which words or combinations of words produced it.

Why use a single post?

The unit of prediction shapes the question a study can answer. An account history offers a classifier recurring topics, habits of expression, and observations from several occasions. A single post offers whatever language happens to be present in that contribution. An account with few contributions, or one belonging to a person who mainly reads discussions, provides little text for an approach that depends on a substantial history. Dinu and Moldovan want to know whether a method can operate on the smaller unit.

The resulting task joins information at two levels. SMHD associates the condition with the account, while the prediction is made from the post. A post about an unrelated subject still has the condition-group label if its author belongs to that group. The result is a study of whether an account label can be recovered from a piece of writing. It does not depend on a human reader judging that the particular post expresses the condition.

This choice also changes how to think about the evidence in a negative result. A post may have little content relevant to the distinction, even if its author has written other posts whose vocabulary places them more clearly in one group. In the experiment, the classifier must assign a label to the post in front of it. Detecting positive cases therefore depends in part on how often the conditions associated with the author also have some recognizable correlate in a randomly selected contribution.

The authors’ comparison covers several conditions, but the prediction problem remains binary for each condition. This lets the study ask how well each group can be separated from controls without requiring the classifier to decide, for instance, whether one condition is a better explanation than another for a piece of writing. The study’s broad coverage concerns the number of separate contrasts that are examined. The distinction between performing several binary tasks and performing a single diagnostic classification is essential to reading the results.

The method, step by step

How a post gets its label

SMHD begins with Reddit accounts. For the condition groups, its creators searched support communities for self-reports of diagnoses. They then assembled writing by the identified accounts from general discussion communities. The control accounts were selected for having at least 50 Reddit posts and no posts in the support communities used to define that comparison. The full dataset contains 20,406 users in the diagnosis groups and 335,952 control users. Those are counts of users in SMHD as a whole. Dinu and Moldovan’s experimental samples are measured in posts.

SMHD’s labels cover conditions at different levels of the DSM-5 taxonomy. Depressive disorders, bipolar disorders, anxiety disorders, and schizophrenia spectrum disorders are represented. The dataset also includes obsessive-compulsive disorders and feeding and eating disorders. The other categories are post-traumatic stress disorder, autism spectrum disorders, and attention-deficit/hyperactivity disorder. The paper uses abbreviated names for these labels in its result tables, including PTSD, OCD, and ADHD. A category such as eating is therefore shorthand for a dataset group, instead of a label manually assigned to every post that mentions food.

To build an experiment for a particular condition, the authors take posts from the corresponding group and posts from controls. A general-discussion post from an account identified with the condition gets the condition-side label for that experiment. A post from the control group gets the comparison label. The same procedure defines the task for other conditions. A new prediction assigns one of the two labels available in the specific task for which the classifier was trained.

The control definition is concrete and important. The absence of posts in certain communities is an observable selection rule. It establishes eligibility for the dataset’s comparison group. The training procedure uses that group exactly as selected. It has no additional clinical assessment with which to establish that comparison users are free of the conditions being studied.

From Reddit account labels to post-level predictions

The steps in order.

From Reddit account labels to post-level predictionsStep 1: Identify condition and control accounts in SMHD1. Identify condition and control accounts in SMHDStep 2: Draw general-discussion posts from each group2. Draw general-discussion posts from each groupStep 3: Clean the text and remove very short posts3. Clean the text and remove very short postsStep 4: Split each binary sample into training and testing4. Split each binary sample into training and testingStep 5: Tokenize and format posts for each classifier5. Tokenize and format posts for each classifierStep 6: Fine-tune pretrained classifiers on labeled posts6. Fine-tune pretrained classifiers on labeled postsStep 7: Score condition and control predictions on test posts7. Score condition and control predictions on test posts

Sampling posts and preparing the text

The authors work with a sample because training on the complete dataset would take longer. They choose the sample by post instead of fixing the number of users to draw from each group. The amount an account writes varies, so drawing an equal number of users could yield very different amounts of text for the groups being compared. The paper illustrates this with depression and ADHD as groups with similar comment totals and with PTSD and eating disorders as groups whose comment totals are less balanced.

The reported sampling rule is to draw 50,000 posts at random from each group. In the Results section, a binary comparison combines 100,000 posts and allocates 80,000 to training and 20,000 to testing. This gives the two groups equal representation in the assembled sample. An equal number of posts still permits an unequal number of authors or an unequal contribution from each account. Those are different properties of the sample, and the paper’s stated rule directly addresses the number of posts.

Reddit contributions also vary in length and purpose. The paper connects those differences to the activities of writers and the formats of communities. A brief comment can acknowledge another contribution, whereas a discussion organized around storytelling may invite a substantial reply. This matters for training because very short text may give the classifier little material and because long text can exceed the sequence length used in an experiment. Both ends of the distribution can affect what reaches the classifier.

SMHD had already been preprocessed when the authors received it. They apply further cleaning. They remove posts shorter than 4 tokens, explaining that brief acknowledgments and similar replies frequently contain little material for the task. They also remove special symbols and characters and use a dictionary to expand contractions. A token is a unit of text as divided by a particular processing procedure. The paper describes the short-post filter and the architecture-specific input preparation separately. The specific tokenizer used to assemble a classifier’s input determines the pieces that the classifier actually receives.

The length figures give a sense of the material being processed. In the paper’s token-statistics table, the reported mean for the anxiety group is 24.16 and the mean for the PTSD group is 46.42. For the eating group the reported mean is 42.92. These are descriptive values for the groups in that table. They show variation in the amount of text available, but a group mean cannot establish how many posts reach a particular input limit or whether the differences in average length account for any predictive result. The length cap applies to individual sequences.

Turning the post into input for a classifier

Each system starts from weights obtained through pretraining. The point of fine-tuning is to adapt those weights to the labeled Reddit task. The training examples pair a prepared sequence with its condition or control label. The sequence-classification component turns the representation of the post into a prediction for those labels. Training adjusts the system using the labeled examples, after which the corresponding test posts are fed through the trained classifier and evaluated against their dataset labels.

BERT uses context from both sides of a position in the text. In a short post, surrounding words can help distinguish uses of the same term and provide information about how it relates to the rest of the contribution. The authors use the Hugging Face PyTorch implementation BertForSequenceClassification. They preserve the special input format expected by BERT, including the classification marker [CLS] at the beginning and the separator [SEP]. These markers are elements of the input format. The brackets are part of the token names and do not indicate annotations added by a human reader. Transformers: State-of-the-Art Natural Language Processing

Tokens in a batch must be fitted to an input shape the implementation can process. Padding adds positions to a sequence that is shorter than the chosen length. Truncation removes text beyond the allowed length. An attention mask marks which positions belong to the sequence and which were added as padding, so the added positions can be treated accordingly. Padding preserves the amount of genuine text in a short input. Truncation changes the evidence available for a long one. The paper gives 512 tokens as BERT’s supported maximum. That figure describes the system’s capacity and should not be read as a measured length for the Reddit posts.

The authors tried different training settings before settling on the reported BERT setup. Their machine led them to use a batch size of 3, meaning that the update procedure worked with batches containing that many examples. They trained for 3 epochs, an epoch being a pass through the training data. They report seeing overfitting from the 4th epoch. Overfitting here refers to a loss of usefulness on held-out material as training continues to adapt to the examples it sees. The paper gives the authors’ account of when they noticed it, without a learning curve from which to trace the change.

The paper describes XLNet as a pretrained alternative intended to address limitations of BERT. It uses different input formatting, and the authors describe padding the shorter arrays to match the longest sequence being processed. In their experiment, computational resources led them to cap sequences at 126. They report a batch size of 8 and training for 4 epochs. The resource-driven cap is part of the tested configuration. A comparison involving that configuration therefore includes the effect of any text it omits beyond the limit. XLNet

For RoBERTa the authors load the pretrained weights through RobertaForSequenceClassification. According to their report, each batch contains eight sequences, each 256 in length. The earlier work introducing RoBERTa examined how training and design choices affected BERT’s performance. In the Reddit study, the relevant comparison is how the adapted RoBERTa system performs on the same kind of condition-versus-control decisions. Its sequence length is part of that comparison alongside its pretrained starting point. RoBERTa

What the training settings specify

The authors name AdamW for training. An optimizer governs how the adjustable weights are updated using information from the loss, which measures how the predictions depart from the training targets. The paper sometimes describes AdamW in terms of the loss. In reading the settings, it is useful to distinguish that label from the optimizer parameters actually reported. The hyper-parameter table lists weight decay of 0.0 for BERT and XLNet and 0.0-0.1 for RoBERTa. Weight decay is a setting for regularizing the weights during updates. The range in the table gives the reported values for RoBERTa without identifying a condition-specific choice within that range. Decoupled Weight Decay Regularization

The table gives the same AdamW β entries, 0.9 and 0.999, for each classifier. Here β denotes the coefficients governing how the optimizer retains past information in its running estimates. The symbol ε identifies another optimizer setting in the table. The table gives ε as 1e-5 for BERT, 1e-5 for RoBERTa, and 2e-5 for XLNet. The RoBERTa prose instead gives 2e-5, and the XLNet prose describes its AdamW settings as the same as BERT’s. The BERT prose also labels its value as a learning rate while using the notation for Adam ε. These inconsistencies leave the precise mapping of some optimizer settings unresolved.

A similar issue concerns the training count. The hyper-parameter table lists 100,000 training posts and 20,000 testing posts for each architecture. The narrative Results section describes 100,000 as the whole sample in a binary comparison, then gives 80,000 training and 20,000 testing posts. The prose on XLNet also discusses roughly 100,000 texts in connection with training and reports 50,000 training steps. The Results section’s explicit partition is the basis for describing the main evaluation. The other counts are insufficient to reconstruct an exact schedule of updates.

The paper’s description of tuning gives the variables which were explored and some settings ultimately used. It does not give an explicit scoring equation, loss equation, or update rule for these experiments. Its training procedure is specified mainly through named implementations, the source of the labels, sequence preparation, and the reported settings. This level of detail supports a reconstruction of the experiment’s main stages while leaving some of the exact implementation choices open.

The parallel analysis of words

The authors run a separate analysis with a Naïve Bayes classifier from scikit-learn to identify informative words for the condition groups and the controls. Naïve Bayes treats features as conditionally independent given a class. In this part of the study, its role is to help inspect vocabulary associated with the labels. The resulting table reports chi-square scores for words on the condition and control sides. A higher score in the table indicates a stronger association with the corresponding group according to the analysis.

The word analysis has a different purpose from fine-tuning a sequence classifier. It yields terms a reader can examine directly. This helps establish whether a group distinction has a recognizable topical component. It also exposes cases where the signal might have more to do with the way Reddit communities talk than with a clinical description of the condition. The word scores are association measures, and the table provides no explicit equation for how those scores were obtained.

For the eating group, the ranked vocabulary includes carbs, calorie, and rice. These words can occur in an ordinary discussion of food and are meaningful in the context of the paper’s hypothesis about eating-disorder classification. In other groups the authors find examples concerning relationships, medication, or emotion. They also identify Reddit-specific terminology, including TRP, which they interpret as a reference to a particular community. The mixture of general and platform-specific vocabulary makes this analysis informative about what can survive the choice to sample general discussions. The paper treats the rankings as a descriptive companion to the prediction results and gives no procedure that feeds the ranked terms into the pretrained classifiers as additional features.

Experiments and results

What the test measures

The test asks whether the classifier agrees with SMHD’s label for a post. The paper’s Results section describes 20,000 testing posts for a binary comparison, following training on 80,000 posts. Eating disorder versus control, depression versus control, and the other comparisons are evaluated as their own tasks. A prediction for one comparison says which side of that comparison the post resembles under the learned rule. There is no evaluation of a combined decision that assigns a post to one of all the conditions.

The paper reports accuracy as well as precision, recall, and F1. Accuracy is the share of predictions that match the assigned labels. Precision for the condition group asks how many posts assigned to that group actually carry its label. Recall for that group asks how many posts carrying the condition label are recovered. Precision and recall can likewise be reported for the control label by treating that label as the one to be recovered. F1 combines precision and recall and falls when one of them is weak. Compared with accuracy, the class-specific measures reveal more about which side of the distinction the classifier recognizes successfully.

Reporting both sides is useful even in a balanced sample. A classifier can find condition-group posts readily while also assigning the condition label to many controls. A single overall accuracy summarizes those outcomes together. The precision and recall entries can show how that aggregate result arose. For instance, the BERT eating comparison gives precision of 0.82 and recall of 0.83 for the eating group. Its control-side precision is 0.80 and its control-side recall is 0.78. Each figure describes a different direction of success or error in the same binary task.

The paper presents two levels of results. Its classifier table gives class-specific detail for the systems tested, listing the condition and control sides. Its comparative table gives F1 figures by condition for BERT, the best entry from the current study, and earlier work. The comparative table does not specify how its F1 entries were aggregated from the class-specific results. The comparative figures are therefore best read under the labels in that table. For example, the comparative eating-disorder result of 0.81 is a reported F1, while the paper separately reports 81% as its highest accuracy. These figures describe different metrics.

Performance across the conditions

In the comparative F1 table, eating disorders give the strongest result, 0.81 with BERT. PTSD follows at 0.76, with XLNet credited in the best-results column. That column gives 0.75 for OCD with BERT and 0.75 for bipolar disorder with RoBERTa. Schizophrenia reaches 0.73 with BERT, and the anxiety entry is also 0.73, credited to all the tested architectures. The same table records 0.71 for ADHD with RoBERTa and 0.71 for autism with BERT. The lowest value in the best-results column is the depression result of 0.70 with XLNet.

The condition breakdown shows why the choice of classifier cannot be summarized by a single ranking. The discussion credits BERT with leading accuracy results for schizophrenia, OCD, eating disorders, autism, and anxiety, while the comparative F1 table also credits XLNet and RoBERTa for some conditions. The BERT and best-results columns sometimes show the same score even when the best-results column names a different system. For example, BERT’s comparative F1 for PTSD is 0.76 and the column naming XLNet also reports 0.76. The entries establish equality at the precision shown. The paper does not provide a finer-grained ranking for that example.

The depression results show a different pattern from eating disorders. In the class-specific table, BERT’s depression-group precision is 0.73 and its depression-group recall is 0.70. For controls in that task, precision is 0.63 and recall is 0.66. The comparative BERT F1 for depression is reported as 0.68. These measures add detail to the paper’s description of depression as the hardest of the conditions by best reported F1. They also make clear that the difficulty concerns the distinction between the two groups. Results on both sides matter to an explanation of what went wrong.

The descriptive vocabulary results give the authors a reason to take the condition differences seriously. Eating and diet contributed a recognizable cluster of terms in the word analysis. For depression, the authors suggest that whether emotional states become visible in language can depend on context and that general conversations need not bring those states into view. The experiment directly measures how predictable the group label is under its sampling and test procedure. The proposed account of why predictability varies is an interpretation informed by the words and the literature discussed in the paper.

Comparison with earlier work

Cohan and colleagues introduced SMHD and provided earlier classifications against which the authors compare their results. Dinu and Moldovan describe the earlier accuracy figures as approximately 50%, with a reported best of 57% for supervised FastText on bipolar disorder. They describe their own accuracy figures as approximately 75%, with a reported maximum of 81%. These are the paper’s broad descriptions of the two sets of results. They are distinct from the condition-specific F1 comparison, even when the same digits appear.

For the comparative F1 table, Dinu and Moldovan select earlier scores associated with different methods. The caption lists support vector machines, logistic regression, FastText, and convolutional neural networks among those methods. Elsewhere the paper characterizes the earlier work as having used no deep learning. The actual comparison is most securely described by the named methods and tabulated F1 scores, which avoid relying on that broad characterization. The two studies draw on the same dataset resource, but the table does not establish a rerun of the older classifiers using the exact current post sample and split.

Jiang and colleagues are the closer comparison for the question of what an individual post can tell a classifier. Their work supplies earlier post-level F1 figures for several of the same conditions. The current paper reports the BERT values beside them, then supplies a separate column for the best result from its own classifiers. This presentation allows the reader to see both how one current classifier compares consistently across tasks and how the best tested choice varies by condition.

Reported eating-disorder F1 on SMHD across studies

The current BERT entry is higher than both earlier reported entries.

Reported eating-disorder F1 on SMHD across studiesCohan and colleagues: 0.44Cohan and colleagues0.44Jiang and colleagues: 0.73Jiang and colleagues0.73Dinu and Moldovan, BERT (this paper): 0.81Dinu and Moldovan, BERT (this paper)0.81
The numbers
System or settingF1
Cohan and colleagues0.44
Jiang and colleagues0.73
Dinu and Moldovan, BERT (this paper)0.81

The eating comparison shows the value of keeping the two earlier references visible. The earlier SMHD figure and the earlier post-level figure represent different comparisons for the current study. The fact that both fall below the current BERT result describes what the paper’s table shows. It does not identify a single intervention responsible for the change. Differences in the input unit, the training approach, and the data used in the experiments can matter when a score is taken from a different study.

Reported depression F1 on SMHD across studies

XLNet gives the strongest current depression entry, with both current entries above the earlier scores.

Reported depression F1 on SMHD across studiesCohan and colleagues: 0.53Cohan and colleagues0.53Jiang and colleagues: 0.59Jiang and colleagues0.59Dinu and Moldovan, BERT: 0.68Dinu and Moldovan, BERT0.68Dinu and Moldovan, XLNet (this paper): 0.70Dinu and Moldovan, XLNet (this paper)0.70
The numbers
System or settingF1
Cohan and colleagues0.53
Jiang and colleagues0.59
Dinu and Moldovan, BERT0.68
Dinu and Moldovan, XLNet (this paper)0.70

The depression comparison emphasizes another distinction. Improvement over an earlier result and difficulty relative to the other conditions can occur together. The current depression classifiers score above the earlier entries for depression, while the best depression entry is still lower than the other current condition scores. The earlier numbers say how the new work compares with published attempts at that task. The other condition scores say how the task compares within this study’s set of experiments.

The other comparisons support the paper’s claim that the improvement over Jiang and colleagues extends beyond the strongest condition. For schizophrenia, Jiang and colleagues are listed at 0.61 and the current BERT result at 0.73. For OCD the figures are 0.62 and 0.75. For bipolar disorder the scores are 0.61 and 0.73, and for anxiety they are 0.68 and 0.73. In the PTSD task, the earlier post-level comparison gives 0.57 and the current BERT score is 0.76. All these figures are F1 entries in the comparative table. The paper does not supply a Jiang comparison for ADHD or autism.

The Cohan entries fill out the earlier comparison for both of those conditions. The table gives 0.47 for ADHD and 0.49 for autism from the earlier work, with 0.71 for each in the current best-results column. For the same comparison on anxiety, the earlier entry is 0.54, while the current table gives 0.73. PTSD has an earlier SMHD F1 of 0.57, and the current best-results column gives 0.76. Comparing the task-by-task values makes the scope of the improvement clearer than a single description of its size. The paper’s general statements about the size of the gain combine comparisons whose individual values and experimental conditions differ.

What the ablations show

The paper reports no formal ablation in which an input feature or training component is removed while the rest of the experiment is held fixed. It instead offers comparisons across pretrained classifiers, a condition-by-condition vocabulary analysis, and observations from tuning. These provide evidence about different parts of the experiment. The architecture comparison measures the effectiveness of complete configurations. The word analysis identifies associations readers can inspect. The tuning observations explain some choices made during training.

Architecture comparisons test complete configurations

Running BERT, XLNet, and RoBERTa on the condition-versus-control tasks addresses the practical question of whether performance depends on which system is adapted to the dataset. The paper’s comparative F1 results show that it can. BERT is credited for the strongest eating-disorder result, while XLNet improves on BERT’s listed depression result. For bipolar disorder, the best-results column credits RoBERTa. Anxiety produces the same reported best F1 across the systems. This is a more informative account of architecture choice than declaring a winner from the largest single result.

The comparison changes several things at once. The systems begin with different pretrained weights, receive differently formatted sequences, and use different training settings. XLNet is tested with a resource-driven sequence cap, while RoBERTa is tested with its own fixed sequence length. Some differences are therefore differences in the amount of any long post that can be used. The paper provides no matched-length experiment that could isolate the contribution of the pretrained architecture from that of the sequence cap.

A clean test of a particular mechanism would also require a comparison deliberately constructed around that mechanism. The strong eating-disorder score, for example, is consistent with the system using diet vocabulary. The architecture comparison alone cannot show whether favorable performance came from recognizing individual words, recognizing how those words were used, or exploiting other distinctions between the account groups. All of these kinds of evidence could be present in a post.

The ranked words make some associations visible

The Naïve Bayes analysis reports a chi-square score of 71.0 for carbs on the eating-group side and 47.5 for calorie. These are scores for word associations in the feature table, rather than classification F1 values or measures of the importance of the words inside BERT. The examples show that the groups can be distinguished partly by topics that occur in ordinary discussion. Food terms can be informative in the dataset without being names of diagnoses.

The depression vocabulary table shows why an inspection of terms can help even when there is no simple thematic explanation. It includes caffeine, meds, and flirting on the condition side. It also includes entries such as Mii and cigars, whose displayed scores favor the control side. The two-sided comparison lets readers see that a list assembled for a condition can include words characteristic of its controls. An account’s predicted group can be influenced by what is more common on either side of the comparison.

Other words point to the social setting where the writing was collected. The schizophrenia word list includes terms related to spirituality and meditation. The PTSD list includes a Reddit community abbreviation, as well as words concerning therapy and boundaries. The presence of such terms illustrates how a statistical distinction can combine subject matter with the language of particular communities. A vocabulary table helps expose those possibilities in a way that a classification score by itself cannot.

The authors explain the especially strong eating-disorder result in part through food and diet vocabulary and the weaker depression result in part through the contextual expression of emotional states. Testing these explanations causally would require evidence about how predictions change when those cues are withheld, or when comparisons are made between posts on matched topics. The study leaves those comparisons open. Its analysis establishes that the word associations and the predictive performance coexist in the sampled data.

Tuning observations explain a stopping choice

The paper reports trying several training settings and says that the authors stopped BERT training after 3 epochs because they observed overfitting from the 4th epoch. This is a practical training observation. It explains why the authors chose an earlier stopping point despite considering longer training. The paper gives no epoch-by-epoch scores, so the size and consistency of the effect across conditions are unspecified.

The same applies to the choice to discard posts shorter than 4 tokens. The authors explain that short acknowledgments often give little basis for a group decision. The reported results come from the procedure with that filter in place. There is no result for the corresponding experiment with those posts restored, so the score cannot be used to estimate the benefit of filtering. The same logic applies to contraction expansion and removal of symbols. The paper assesses the assembled pipeline and uses separate observations to motivate its parts.

Limitations

Limits the authors identify

The authors explicitly discuss the population and behavioral biases of Reddit data. The report they cite puts the share of Reddit users who are male and between 18 and 34 years old at over 60%. That is a platform-level figure from the report they discuss, rather than a demographic measurement of the experimental sample. In their account, Reddit can provide writing from a population that may be underrepresented in clinical research or reluctant to discuss emotional difficulties in other settings. They also acknowledge that behavior observed on a platform cannot be claimed to represent all people with a condition.

The authors argue that gathering writing from general communities helps because the material covers varied subjects. Their discussion of Reddit also allows for the possibility that the setting changes what people are willing to say. Anonymity and community norms can shape disclosure. Both observations are relevant to the results. Moving away from support forums gives access to a different range of conversation, while the language remains language produced on Reddit. Topic variety and population representativeness are separate properties.

The authors identify computational limits on the experiments as well. They use a sample of SMHD to avoid the training time required for the full dataset, and limited resources influence the batch sizes or sequence lengths they can use. The reported results belong to those choices. The paper leaves the effect of using the entire dataset unexplored. It also leaves open how results might change if the available text were lengthened under the same training conditions.

In their conclusion, the authors call for experiments with more diverse data and with contextual cues such as the timing of posts, related events, and relationships between contributions. Their suggestion follows from the observation that the character of a post depends on the circumstances in which it was written. They present earlier detection and assistance to clinicians as possible directions for continued research. The reported study evaluates retrospective labels on selected Reddit text and gives no clinical outcome measure.

Limits visible in the study design

The labels come from self-reports and account activity. The condition examples are posts written by users identified through their disclosures in support communities. A post inherits that label whether it describes a symptom, a conversation about a hobby, or an everyday question. The control examples come from accounts satisfying the comparison rule. As a result, a correct prediction is agreement with the dataset’s definition of group membership. Establishing agreement with a clinician’s assessment would require another source of labels and an evaluation designed around that source.

The absence of support-group posts in the control selection rule can also create a behavioral difference even before the general text is examined. People who publicly report a diagnosis in such spaces have done something that control accounts have, by construction, no recorded history of doing in those spaces. That distinction can correlate with interests, platform use, and other kinds of disclosure. The paper can measure associations between writing and the resulting labels. It cannot determine from those associations how much of the observed signal is attributable to a condition itself.

The split calls for particular care. The paper describes sampling and predicting individual posts and gives counts for the training and test partitions. It does not state that the accounts behind the training posts were held apart from the accounts behind the test posts. The evaluation therefore establishes performance on held-out posts under the reported procedure. Whether it also measures generalization to completely unseen authors is unresolved. If the same account contributes text on both sides, recurring vocabulary or writing habits could help with test predictions. The reported description neither documents such overlap nor rules it out.

Sampling posts also makes frequent contributors potentially more influential. Drawing the same number of posts per group controls the number of examples in the binary comparison. It does not control how many of those examples can come from an individual account. The same headline result can therefore summarize stronger performance on accounts with many contributions and weaker performance on accounts with few. The paper’s motivation includes the latter kind of account, but it does not report performance broken out by how much the author has written.

The balanced comparisons have a further consequence for interpreting precision. In the assembled sample the condition and control groups contribute equal numbers of posts. In an unrestricted stream the proportion carrying a given condition label is unspecified. Precision depends on how common the target label is in the material being examined as well as on how frequently a classifier misses positives or assigns positive labels to controls. The reported precision belongs to the test sample. It cannot be carried directly over to a population with a different label distribution.

What the text and scores leave unresolved

The paper describes the general-discussion text as having been filtered to remove mental-health terms, yet the vocabulary analysis contains words such as therapy, medication, and psychotic. These observations can coexist if the filtering was aimed at particular explicit mentions while leaving broader related vocabulary in place. The paper does not specify a boundary for that interpretation in enough detail to verify the treatment of every term. The setup clearly limits the source of the classified writing to general discussion. Readers should treat the absence of all potentially revealing vocabulary as a separate and stronger condition.

The groups can also differ in what they write about and where they write it. The eating-group vocabulary provides a concrete example. A classifier that uses food words can perform well when those words are unevenly distributed in the sampled posts. Performance on a different set of conversations, where people from both groups discuss food with similar frequency, is an open question. The study does not report a topic-matched or community-matched test that would reveal how much separability remains when those factors are held more almost constant.

Interpretation of the earlier comparisons likewise depends on the protocol. Scores chosen from prior papers show how the current values stand in relation to the available results. A tightly controlled attribution of the improvement would require running the competing approaches on the same partition with comparable preprocessing and input units. The reported work supplies useful comparisons to prior findings and a comparison of its own complete configurations. The exact contribution of pretraining, the unit of prediction, and the sample is left unresolved by the across-study comparisons.

Reproducibility is affected by the conflicting training counts and optimizer descriptions, and precision in ranking is affected by the way the results are reported. The paper gives point estimates without repeated-run variation or uncertainty intervals. Equal printed values establish equality at the displayed precision. Nearby values should be read with the same attention to reporting precision, especially where the experimental question is which architecture to prefer for a particular condition. The broad pattern across tasks is visible even though the reliability of individual rankings cannot be assessed from the reported figures.

Finally, the experiment has no timing-based test of early detection. The labels come from accounts already identified through self-reports, and the paper does not report a split organized around whether the writing preceded the disclosure or onset of the condition. Prediction from selected historical text and prediction before a condition is recognized require different evaluations. The paper’s evidence is strongest for a narrower question: how well general Reddit posts from these sampled groups can be separated using the tested procedures.

What came after

MindSET: Advancing Mental Health Benchmarking through Large-Scale Social Media Data (2026) cites Dinu and Moldovan and addresses mental health benchmarking with social media data. Dinu and Moldovan give a concrete example of the kind of experimental definition that makes such benchmarking interpretable. Their labels come from account-level information, their predictions come from individual posts, and their main comparisons separate each condition group from controls.

The citation establishes a connection between the papers. How MindSET uses those particular choices is unspecified. Direct reuse of SMHD, replication of the single-post experiment, or adoption of any particular classifier cannot be inferred from its title and citation. The documented connection is the continuing use of social media writing as material for evaluating mental health classification, with Dinu and Moldovan’s study providing an earlier result for general Reddit discussions at the level of the individual post.

Cite

Cite as Anca Dinu and Andreea-Codrina Moldovan. 2021. Automatic Detection and Classification of Mental Illnesses from General Social Media Texts. Proceedings of the International Conference on Recent Advances in Natural Language Processing (RANLP 2021).

The paper itself, not this page. BibTeX from the library's record of the work.

@inproceedings{dinu2021automatic,
  title = {{Automatic Detection and Classification of Mental Illnesses from General Social Media Texts}},
  author = {Anca Dinu and Andreea-Codrina Moldovan},
  booktitle = {Proceedings of the International Conference on Recent Advances in Natural Language Processing (RANLP 2021)},
  year = {2021},
  url = {https://aclanthology.org/2021.ranlp-1.41/}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/dinu-2021-automatic-detection-classification-mental-illnesses/