1 Introduction

With the emergence of online social media, exchanging information on these platforms has become significantly more popular. These social media platforms have become important facilitators in various areas, such as identifying the sentiments of people regarding a product, public opinions about various events, sharing daily life events, and discussion forums regarding diseases and medications (Dolezal et al. 2022 and Marsch 2021). There is a tsunami of posts by users on these social media platforms, and this user-generated content on social media has provided researchers with opportunities for exploring and categorizing this content in domains such as marketing, politics, and health. Social media platforms such as Facebook, Twitter, and Reddit turned out to be the safest space for people to post their emotions, feelings, thoughts, etc. (Yoo et al. 2019). With users being open about their mental states on such platforms by continuously posting about how they are feeling or tackling their mental disorders, their content has provided a rapid method for researchers to train classification models for detecting users with mental health disorders (Saha and Munmun 2021).

In the past decade, mental health has become a global health concern. From 2005 to 2015, the number of people having depression globally elevated by 18.4% [WHO, 1]. Mental health disorders can impair an individual emotionally and physically with common diseases such as stroke, heart disease, etc. People with mental health disorders also experience sleep disorders, low energy, helpless feeling, less interest in daily activities, suicidal thoughts, and intense concentration levels (Cohen et al. 2022). The World Health Organization published a study in 2020 in which 264 million people were affected by depression (Depression 2021). In England, the treatment for mental health at work reached 105 billion British pounds (Health Matters, 2022).

Mental health disorders are treated using traditional approaches in which the patient interacts with the therapist in one-to-one interaction. These are reactive approaches in the form of one-to-one interviews, questionnaires, and surveys which makes it time-consuming and expensive (Bathina et al. 2021). These approaches are not that effective as they are dependent on factors such as the mood of the patient, the bond between the patient and the therapist, and the past experiences of the patient (Karcher et al. 2021). With the stigma attached to mental health disorders and the lack of awareness, patients hardly recognize their mental health in their initial stages and generally approach the clinician in the later stage of the disease. A study found that 70% of people do not understand their mental health until the symptoms are worse, and then in the severe stage, they approach the clinician (Shen et al. 2017).

1.1 Need for using AI for mental disorder detection

Limited mental health-care services with ineffective techniques have hampered the physician’s time. Mental health practitioners need unique skills to provide personalized treatments to mental health patients to stimulate therapeutic support and medications to the patient and their family members, as every individual has a unique personality (Mendu et al. 2020). The current applications and techniques of artificial intelligence added a lot of support in the detection and diagnosis of mental health care. These techniques are widely used to draw insights from different data sources, fostering a better recognition of mental illnesses among the population by uncovering the factors leading to risk (Shrestha and Spezzano et al. 2019). AI algorithms also enable online therapeutic sittings along with the provision of self-assessment to patients who lack access to these services in certain areas. People do not generally consult doctors during their initial days of mental illness. Doctors cannot monitor all the patients simultaneously, so there should be a procedure that could help the doctors deal with the patients. The AI approaches have changed the treatment game by enabling a healthy clinician–patient relationship (Kiong 2022).

The public, private, and institutional stigma associated with mental health have made treating mental health more difficult. The prejudice related to mental health is because of the lack of understanding and the fear of losing livelihoods and social acceptance associated with it. Online platforms let an individual hide their identity, which gives an individual the confidence to share about their mental well-being (Hu 2022). These platforms allow users to post about their well-being in the form of either text or image, or video. Most of the data is available in text form on different social media platforms. This text can be analyzed with the help of text mining and sentiment analysis. Natural language processing (NLP) is the subfield of text mining that combines the power of linguistics, and computer science to make programs to analyze natural language data involving speech and text. The most common NLP tasks are speech recognition, natural language understanding, language translation, information extraction, and natural language generation. NLP studies the rules and structure of the language with the help of lexical, syntax, semantics and pragmatics, and morphology. NLP comes in handy when studying online social media, as the majority of the data available is in the form of text. Even, mental health procedures are highly dependent on NLP as there is an enumerable amount of raw textual data, i.e., clinical notes, and counseling sessions between the therapist and the patient (Ranjana et al. 2022). A basic application of NLP is encountered while using Gmail, where each mail is automatically classified as primary, social, promotion, and spam (Diniz et al. 2022). This is possible with the help of the keyword extraction technique of NLP. NLP is combined with computational linguistics, machine, and deep learning to empower the systems to investigate the human language in the form of speech to draw complete conclusions and intent (Ricard et al. 2018).

Existing research spanned a wide variety of methods for identifying mental states. Nonetheless, we think that our assessment is suitable for the use of computational techniques considering the rising popularity of using online social media to seek help and guidance for mental health disorders. The purpose of this review is to carefully examine the usefulness of extracting and analyzing information from online social media with NLP and ML approaches for individuals experiencing mental health-related issues.

In this research, we discuss about the multiple mental health disorders on online social media in which the features are taken from online textual cues and combined with machine learning, deep learning, and ensemble approaches to detect signs of mental episodes.

For health informatics in general and computational strategies in mental health diagnosis in particular, we believe that this review can be useful to researchers performing experiments with social media text data. In conclusion, our review's most significant findings are as follows:

  1. 1.

    The goal of this study is to conduct a literature analysis and methodology comparison on mental health detection and identification in online social media using computational methods.

  2. 2.

    Evaluation of current methods, as well as discussion of these methods, for text analytics in social media platforms online.

  3. 3.

    To share knowledge about the most pressing unanswered questions and viable computational solutions in the field of health-related textual information research.

  4. 4.

    The limitations of using online social media for research purposes.

The remaining paper is structured as follows: First of all, we discuss the previous review studies that have been published by various researchers in this field, and how our review is different from others. In the next section, we discuss the objectives of this study, and how the studies were selected and included in this work. After that, we discuss how the review studies are classified for our work. After that, we discuss the limitations of this review. Then, in the conclusion part, we compare and describe the current state of the art in natural language processing and machine learning methods for identifying mental health disorders on online social media. Finally, we provide a list of outstanding issues in the discussion section, outlining productive avenues for future study in this area.

2 Previous review studies

The proliferation of online social media has made it a topic of discussion among researchers. Researchers use online social media for multiple purposes such as health care, sentiment analysis, opinion mining, recommender systems, etc. An enormous amount of survey papers and review papers are available aiming at the use of machine and deep learning for mental health disorders detection using the social media posts of users.

A complicated multifactorial disease, mental illness is influenced by a number of socioeconomic and clinical factors, including individual risk factors. Natural language processing (NLP) techniques show potential in capturing these complex relationships represented in a wide range of textual data, including social media posts, interviews, and clinical notes. This will enable proactive mental health care and aid in early diagnosis. In order to comprehend methodologies, trends, obstacles, and future directions, the authors gave a narrative review of mental illness detection using NLP over the previous 10 years. In this study, 10,467 records representing a total of 399 studies were included. The review demonstrates an upward trend in NLP research on mental disorder identification. Traditional machine learning techniques are outperformed by deep learning techniques, which are given greater attention. The authors also offered suggestions for further research, such as creating fresh detection techniques, deep learning paradigms, and understandable models (Zhang et al. 2022). A systematic review of using machine learning and natural language processing techniques on mental health and their use in the medical field is presented (Le Glaz et al. 2021). Salas et al. reviewed 34 studies for detecting depression from online social media using machine learning from 2016 to mid-2021. The digital libraries included for primary studies are: ACM Digital Library, IEEE Xplore Digital Library, SpringerLink, Science Direct, Google Scholar, and PubMed. The social media platform most extensively researched for identifying depression symptoms was Twitter. The most used linguistic feature extraction technique was word embedding. The most popular machine learning algorithm was support vector machine (SVM) (Salas et al. 2022). Liu et al. conducted a systematic review on using machine learning methods on social media text for detecting depressive symptoms from January 1990 to December 2020. The authors used various search terms to search for the papers for the review. Then, the authors also shared various inclusion criteria to finally include the papers for their study (Liu et al. 2022). Esteva et al. presented a survey paper discussing various deep learning techniques for health care. The major areas covered were computer vision for medical imaging, natural language processing for electronic health records, reinforcement learning for robotic-assisted surgery, and generalized methods for genomics (Esteva et al. 2019). Miotto et al. discussed the recent literature available on using deep learning for health care with the challenges and opportunities associated with them for electronic health records, genomics, mobile, and clinical imaging (Miotto et al. 2017). Rahmani et al. presented a review paper focusing on the use of machine learning in medicine with the pre-processing steps, type of machine learning technique used, evaluation metrics, and applications (Rahmani et al. 2021). Kim J et al. presented a review study on using machine learning for mental health detection on social media data. They presented a literature study of articles from 2015 to 2020 and obtained 565 relevant papers. They mainly focused on papers from Web of Science and Scopus (Kim et al. 2021).

Su et al. presented a detailed study on the uses of deep learning for mental health. They conducted their study based on clinical data, vocal, and visual expression data and social media data (Su et al. 2020). The many methods for data gathering, the most recent trends and technologies in this area, and the current uses of ML and NLP in the monitoring of public mental health are all covered, along with the drawbacks and the gaps discovered while doing research in this area (Skaik et al. 2020). In order to determine the state-of-the-art social media data prediction of mental health status, researchers undertook a comprehensive literature evaluation with an emphasis on the study design, methodologies, and research design of their study. Between 2013 and 2018, 75 studies in this field were selected. The findings describe the procedures for annotating data for mental health status, gathering data and managing data quality, selecting features for pre-processing, and choosing and validating models. The authors presented alarming tendencies regarding construct validity and a lack of reflection in the approaches taken to operationalize and identify mental health status despite the field's growing interest. The authors also offer suggestions to solve these issues, such as a set of suggested publishing reporting criteria and chances for multidisciplinary collaboration (Chancellor and Chaudhary 2020). The paper aims to thoroughly evaluate the literature on NLP and ML techniques used to detect depression in Online Support Forums (OSF). A thorough search was conducted to find studies that looked at ML and NLP methods to distinguish depression disorder from OSF. The PRISMA method was used to choose the articles. A total of 29 publications were chosen and studied for the review. Using the results of this comprehensive study, the authors further examined which combination of attributes obtained using NLP and ML algorithms is suitable for modern depression identification (Nanomi et al. 2021).

Most of the existing review studies have focused on the research published over the course of the past decades. However, this review study specifically directs its attention to the research conducted in the past few years and has a particular emphasis on the studies published in the past 2 years. This review presents the studies on the basis of different mental health disorders on online social media using different techniques. In other studies, the authors have covered mainly the type of mental health disorder and the techniques used. Our review study also focuses on the models used for comparison along with evaluation metrics discussed in the papers and also clarifies whether the research is based on binary classification or multi-classification, topic modeling along with the social networking site used for the dataset and the type of features used.

3 Study objectives

The objective of this study is to present a review of studies that have used social media data for detecting and treating mental health disorders using machine and deep learning. We have tried to review the most updated papers in this area in the past 5 years, i.e., January 2018 to August 2022, while the main focus is to review the studies in 2020–2022.

3.1 Data inclusion

For our study, we start searching using terms such as mental health disorders, stress detection, online social media, and word embeddings. The research is focused on presenting a review of the papers which have utilized datasets from online social media data, including Twitter, Reddit, Weibo, and Facebook. The study focuses on deep learning and machine learning methods to detect mental health from social media data. We have searched various databases for appropriate results, i.e., Google Scholar, PubMed, Nature, Web of Science, JMIR Mental health, NCBI, Medline, ACM Digital Library, MDPI, IEEE Xplore, Science Direct, and Springer Link. We do not have any restrictions on the type of article. The papers are collected from 2018 to 2022.

For our search, we used multiple general terms related to mental health, such as mental health disorder detection, mental issues, and many more. We also used specific mental health disorder terms such as depression, anxiety, etc. We searched for papers focusing on mental health disorders on online social media such as Twitter, Facebook, and Reddit. The focus of the search is only on the machine and deep learning techniques using natural language processing, text mining, etc. Multiple combinations of these queries are sent in parallel to different search databases, as mentioned above. We can understand this with the help of some examples:

Query 1 (Q1): Detecting mental health disorders on online social media using machine and deep learning.

In query 1, we combined the term machine and deep learning with natural language processing, text mining, and other terms mentioned in the methods column of Table 1.

Table 1 Different category and the corresponding keywords used for paper extraction

Query 2 (Q2): Depression detection using machine and deep learning on Twitter.

Here, in query 2, we replaced the ‘depression’ for every mental health disorder that we mentioned in the mental health disorder column in Table 1, and the machine and deep learning term is replaced with terms mentioned in the methods column in Table 1.

Query 3 (Q3): Predicting mental health disorders using transfer learning on Twitter.

Here, in query 3, we replaced ‘Twitter’ with other online social media platforms mentioned in the dataset column of Table 1 and transfer learning with different values in the methods column in Table 1.

Similarly, we generated multiple queries like this by combining the terms mentioned in Table 1. These queries are combined with different combinations mentioned in the table to get a universal set for our research.

$$Q1{\mkern 1mu} U{\mkern 1mu} Q2{\mkern 1mu} U{\mkern 1mu} Q3{\mkern 1mu} U{\mkern 1mu} Q4{\mkern 1mu} U{\mkern 1mu} Qn{\mkern 1mu} = \hat{U}$$

Here Q1, Q2, Q3,…Qn represents the different combinations of the queries that we have used for searching our papers.

Û represents the final set of papers obtained from all the different combinations of these queries by running a search on all the databases mentioned above.

These keywords were combined using the Boolean operator ‘or’ and ‘and.’

3.2 Exclusion criteria

In this section, we mention the criteria used to finalize the papers for this review. We have identified some exclusion criteria for the purpose of this review study. These factors are used to exclude the papers which we considered to be out of the scope of this study.

  • If the article is not focused on using natural language processing, text mining.

  • If the article is based on images, videos, or speech.

  • If the abstract was found later irrelevant, not relating to the mental health data.

  • If the article is just doing statistical analysis for general individuals having mental health disorders without using machine learning techniques.

  • If the article is focused on surveys, etc.

  • Research not focusing on ML and DL techniques.

  • Research not focusing on online social media.

  • Research on patient data in hospitals.

  • Research only performing text pre-processing.

  • Research focusing on physical health disorders.

The exclusion criteria help us to focus on the objective of this research paper. Although there have been many studies published in this area as this is a multidisciplinary research field covering computer engineering, psychology, and medicine. There were studies that have used machine learning techniques for mental health disorders, but they were focused on hospital-based data, so we have excluded such studies. Also, we encountered many studies focused on mental health disorder detection on online social media, but their only focus was doing text analysis and feature extraction, and no algorithms were used in their paper. In this way, we removed the papers according to the exclusion criteria presented above to focus on the studies helpful for this review.

3.3 Results

In this study, 4000 review studies were identified from different database searches, as discussed in the data inclusion section. These studies were then screened for any duplicates. After duplication removal, only 3676 studies were obtained. Then, these studies were searched for full-text access. After rigorous searching, we gathered about 1987 studies for our study. These studies were further evaluated to fall into our search criteria as discussed in Fig. 1 We removed the studies which were out of the scope of this review based on the exclusion criteria discussed above. Finally, we were left with 99 studies presented in this paper.

Fig. 1
figure 1

PRISMA flow diagram for searching of the literature studies

Now, for the purpose of understanding the review study in a more comprehensive manner, we have discussed some research questions. These questions helped us in forming the basis for our study. Some of the research questions are discussed below.

Research Question 1: Which online social media platform is most commonly used for mental health disorder detection?

Answer: There have been many online social media platforms that exist nowadays. The most well-known and most used social media platforms by users and researchers can be summarized below. These social media platforms are not the only ones used by researchers but are also most commonly used by individuals for sharing their opinions and thoughts.

3.3.1 Reddit

Reddit is a social media platform founded in 2005 by Steve Huffman and Alexis Ohanian. The site is organized around user-created communities, known as subreddits, which cover a wide range of topics, from news and politics to hobbies and interests. As of 2021, Reddit has over 430 million monthly active users, making it one of the largest social media platforms in the world (McAuliffe et al. 2022).

One of the unique features of Reddit is its Ask Me Anything (AMA) interviews. These sessions allow users to ask questions directly to a notable person, such as a celebrity or expert in their field. These interviews can provide insights into a wide range of topics and give users a chance to interact with people they may not usually have access (Fraga et al. 2018). In addition to its social and cultural impact, Reddit has become an important tool for researchers and scientists. Due to the platform's unique features, such as its subreddits and threads, researchers can analyze the language and experiences shared by users to gain insights into a wide range of topics, including mental health disorders, political beliefs, and more. Reddit is becoming an increasingly popular tool for mental health research by medical professionals and computer scientists. Due to the platform's large user base and the abundance of user-generated content, it provides a unique opportunity to gain insights into the experiences and behaviors of people with mental health disorders (Ptaszynski et al. 2021).

One-way Reddit is used for mental health research which is through natural language processing (NLP) techniques. Computer scientists and linguists can use NLP to analyze the language used in Reddit posts and comments to identify patterns and gain insights into the experiences and emotions of people with mental health disorders. For example, researchers can use NLP to analyze subreddits dedicated to depression or anxiety to identify common themes and emotions expressed by users. This can help researchers understand the experiences of people with mental health disorders and inform the development of new treatments or interventions (Lau et al. 2016). Medical professionals are also increasingly using Reddit to connect with patients and gain insights into their experiences. For example, psychiatrists and therapists may browse relevant subreddits to understand the experiences and perspectives of people with specific mental health disorders (Chandra Guntuku et al. 2019). This can help them provide better patient care and develop more effective treatment plans. In addition, researchers can use Reddit to recruit participants for mental health studies. They can post study advertisements on relevant subreddits or reach out to users who have shared their experiences with mental health disorders to see if they are interested in participating in a study (Shigemera et al. 2020). This can help researchers recruit a diverse and representative sample of participants for their studies. Overall, Reddit is becoming an important tool for mental health research by medical professionals and computer scientists. It provides a unique opportunity to gain insights into the experiences and behaviors of people with mental health disorders and has the potential to inform the development of new treatments and interventions. However, it is important to use Reddit ethically and responsibly and to respect the privacy and confidentiality of users who share their experiences on the platform (Chang and Tseng 2020).

3.3.2 Twitter

Twitter is a popular social media platform that was founded in 2006. It allows users to post short messages, known as tweets, of up to 280 characters. The platform has grown in popularity over the years and has become a powerful tool for communication, news dissemination, and social engagement. As of the first quarter of 2021, Twitter had 199 million active daily users worldwide, according to Statista. While this is a relatively small number compared to other social media giants like Facebook, Twitter's active user base is highly engaged and influential. Every day, millions of tweets are posted on Twitter, with an average of 500 million tweets sent per day in 2020 (Twitter 2022). This high volume of tweets means that the platform generates a massive amount of data that can be analyzed and leveraged by researchers, businesses, and other organizations. The platform is available in over 40 languages, and users can connect and engage with others around the world. This has led to the development of Twitter communities and movements that have had a significant impact on social and political issues (Chatterjeeet al., 2021). Twitter is a powerful tool that has become increasingly valuable to mental health researchers. Its vast and diverse user base provides researchers with a unique opportunity to analyze how people with mental health disorders are coping, connecting, and communicating in real-time (Ríssola et al. 2021).

One of the primary ways researchers use Twitter is by analyzing the language used in tweets (Sakib et al. 2021). Overall, Twitter is a valuable tool for researchers, offering a unique and dynamic platform to analyze the experiences and behaviors of people with mental health disorders. As the platform continues to evolve and adapt to changing user needs and trends, it will be interesting to see how it can be further leveraged for mental health research and support (Andy 2021).

3.3.3 Facebook

Facebook is a social networking site founded in 2004 by Mark Zuckerberg and his college roommates at Harvard University. Initially, the platform was only accessible to college students, but it quickly expanded to include anyone with an email address. Today, Facebook is one of the most popular social media platforms in the world, with over 2.9 billion monthly active users as of 2021 (The Latest Facebook Statistics 2023). Facebook is a highly interactive platform that allows users to connect with friends and family, join groups, and share content such as photos, videos, and written posts. It also offers a range of features such as event invitations, a marketplace, and fundraising tools, making it a versatile tool for both personal and professional uses. One of the unique aspects of Facebook is its ability to facilitate communities and group connections. Users can join groups based on shared interests, geographic location, or other factors, allowing them to connect with others with similar experiences or concerns. This has made Facebook a powerful tool for social movements and advocacy groups, as well as for businesses and organizations looking to build a loyal customer base (Argyris et al. 2022). In addition to its social and commercial potential, Facebook has become an important tool for researchers and health-care professionals interested in mental health. Researchers can use Facebook to recruit participants for studies, collect data, and analyze patterns in user behavior (Shrestha et al. 2020). Despite its many benefits, Facebook has also faced criticism over the years for its handling of user data and privacy concerns. The platform has implemented a range of measures in response, such as enhanced privacy settings and increased transparency around data usage. However, concerns around these issues continue to be a topic of debate among users and critics alike. Overall, Facebook has had a significant impact on the way we connect and communicate with each other, both personally and professionally. As the platform continues to evolve and adapt to changing user needs and trends, it will be interesting to see how it continues to shape the world of social media and beyond (Behesti et al., 2020).

3.3.4 Seina Weibo

Seina Weibo, often referred to simply as Weibo, is a microblogging platform that was launched in China in 2009. The platform is similar in many ways to Twitter, allowing users to post short messages and updates, as well as photos and videos. Weibo quickly became one of the most popular social media platforms in China, with over 500 million registered users as of 2021 (Yang et al. 2022a, b). The platform's popularity is due in part to its ability to allow users to share their thoughts and experiences in real-time, as well as to connect with others who share similar interests and concerns. In addition to its social potential, Weibo has become an important tool for businesses and organizations looking to reach Chinese consumers (Wang et al. 2020a, b). The platform offers a range of advertising and marketing tools, as well as accesses to a massive user base that is highly engaged and active. Weibo has also been used by researchers and mental health professionals interested in understanding mental health in China (Lyu et al. 2022). The platform offers a unique opportunity to access a large and diverse group of users and to analyze patterns in user behavior and communication related to mental health. This has led to various studies on topics such as depression, anxiety, and other mental health issues. Overall, Weibo is a highly influential platform in China, offering users a powerful tool for communication, connection, and self-expression. As the platform continues to grow and evolve, it will likely remain an important part of the Chinese social media landscape, with implications for social and political discourse, business and commerce, and mental health research and practice.

During our research, we came across multiple standard datasets from Reddit and Twitter, available online. Most of the studies used these two platforms for the research purpose. Limited studies have used Facebook and Seina Weibo. The total studies reviewed in this paper can be visualized with the help of a pie chart in Fig. 2. As can be seen, the maximum studies obtained are from the Reddit social media platform, which accounts for 48% of the total studies. The least studies discovered are from the Seina Weibo platform due to the reason that it is specific for the Chinese population, while 2% of the studies did not specify the exact social media platform, they are using while just mentioning about the posts, comments, etc., being used for the study. These studies are further elaborated in the upcoming sections.

Fig. 2
figure 2

Total studies in the review paper focusing on multiple social media platforms

Research Question 2: What are the different algorithms used for mental health disorder detection on online social media?

Answer: The algorithms that we found in our review studies can be broadly classified as given below:

3.4 Machine learning

Earlier machines were programmed with computational algorithms to follow certain instructions to solve specific problems. Machine learning is the branch of artificial intelligence that empowers machines to learn and behave like humans. Humans have the intelligence to behave according to past experience, machines were lacking in this quality. Machine learning has enabled machines to learn from past experiences to perform specific tasks with specific performance. In 1995, Allan Turing introduced a ‘Turing Test’ which helped in evaluating machines on the basis of their intelligence. In 1995, Arthur Samuel described machine learning as ‘a study which gives computers learning abilities without programming explicitly.’ In machine learning, machines are fed with data and are allowed to learn on their own without any human intervention. Machine learning algorithms are generally comprised of three parts (Myszczynska 2020). First is the decision process, which generally takes some labeled or unlabeled data, and then makes either a prediction or classification. Then, next, we have the error function, which evaluates the model prediction capability. Then, we have model optimization, where the weights are adjusted to reduce the difference between the actual and the predicted values until a threshold accuracy is reached. Sometimes, these models are easily understandable by humans and sometimes, they are complex to understand, similar to a black box. Machine learning algorithms are also as flat algorithms as they cannot be applied directly to the raw data. If the model is not able to capture the underlying patterns of the data and cannot perform well on the testing data, underfitting occurs. When the model is very complex and is trained on too much data, it starts capturing the noise in the data. Such models perform well on the training data but cannot make accurate predictions, in this case, overfitting is said to occur (Rezaii et al. 2019).

3.5 Supervised machine learning (SML)

As the name indicates, in supervised machine learning, we have a supervisor who supervises the learning of the algorithm (Azam et al. 2021). In SML, we have labeled data in which each input has an associated label. We train or supervise our model using this data. The labeled data can be categorical (Yes or no) or continuous (range of values). In SML, we have some input and output variables, and the focus is to have a mapping function from input to output using an algorithm. This mapping function should be able to predict the new data without any labels based on the features provided and the training process (Kang et al. 2016). In SML, we have the correct answers, and the algorithm keeps making predictions on the training data. When the model makes wrong predictions, they are corrected just like a supervisor corrects their students. The model stops learning when the desired performance is reached. Regression and classification problems are the main types of supervised learning problems (Deng et al. 2021).

3.6 Unsupervised machine learning (UML)

In unsupervised machine learning algorithms, data are not provided with labels, and learning happens on its own without any supervision by finding similarities in the input data and getting insights about the structure of the data. In this, we only have the input data and no output labels. It is unsupervised because there is no correct answer as they are identified by different experts. UML enables users to perform more complex operations than SML. UML is more challenging than SML, because of the absence of labels within the dataset. Clustering, dimensionality reduction, and association are the main tasks of unsupervised learning algorithms (Westrupp et al. 2022).

3.7 Deep learning

Deep learning is the branch of machine learning which is influenced by the functioning of the human brain (Saravanan et al. 2022). When humans get any new information, they try to compare it with already available known objects. DL enables the machines to focus on the right set of features by themselves without any or little human intervention (Durstewitz 2019). It used multi-layer structures known as neural networks. Deep learning is capable of focusing on the right set of features requiring very little guidance by the programmer by reducing the dimensionality of the features. It basically skips the manual step of feature extraction as that of machine learning. Deep learning uses neural networks for processing large datasets through multiple hidden layers. The input data passes through the nodes of the neural networks, with each node having some weight. Each layer helps the next layer in refining and optimizing the outputs, and this phenomenon is known as forward propagation. The node which has a higher weight is more important than the node which has a lower weight. In the input layer, we provide the same input entries as our input data, and the output layer consists of the actual output that should come from our data (Sun et al. 2022).

3.8 Attention networks

Attention is a method used in artificial neural networks to imitate cognitive attention. This effect makes some portions of the input data better while making other parts worse. This is done to encourage the network to pay more attention to the critical parts of the data, even if they only make up a small piece of an image or text (Rutowski et al. 2020). Gradient descent trains an algorithm that determines which portion of the data is more relevant than another based on the context (Haque et al. 2020).

In the 1990s, mechanisms resembling attention were developed, known as multiplicative modules, sigma pi units, and hyper-networks. In contrast with normal weights, which must remain fixed during runtime, ‘soft weights’ can alter during runtime, giving them flexibility (Alsayat 2022).

Figure 3 gives us an estimation of the multiple techniques that have been applied by researchers in their papers. Most of the researchers have used deep learning techniques accounting for 44% of our review studies, followed by supervised machine learning techniques. While a very little amount of work is done using unsupervised machine learning accounting for 5% only. This is due to the fact that mental health disorder detection is more of a classification task than a clustering task.

Fig. 3
figure 3

Studies reviewed using different techniques using a 3-D pie chart view representation

Research Question 3: What are mental health illnesses that are mostly recognized on online social media?

Answer: In this paper, we have focused on reviewing the papers based on mental disorders. In those mental disorders, we further categorized the disorders on the basis of which techniques are used to identify the disorders.

4 Classification of mental health disorders on online social media using different evaluation techniques

4.1 Depression

Depression is a mood disorder that enables sadness and loss of interest. Depression affects a person's thinking and behavior, leading to multiple emotional and physical problems hampering the everyday activities of an individual. Depression affected 350 million people globally (Thij et al. 2020). Many people seek medical advice when depression becomes severe, which has many health and economic effects (Maxim et al. 2020). Early detection of depressive symptoms and those at risk of developing them in the community is helpful for formulating public policies and may open up new doors for early intervention or online referrals of those in need of efficient preventive measures (Alexopoulos 2019 and Chiong et al. 2021). Nowadays, online social media has increased the tendency of people to talk about their mental state openly (Depression 2022.)

In this survey, we found several studies on depression detection using machine and deep learning on online social media. We discovered many studies focusing on depression, so we are bifurcating the studies into supervised, unsupervised machine learning, deep learning, and attention networks for the purpose of clarity in Tables 2, 3, 4, and 5, respectively.

Table 2 Depression detection using supervised machine learning techniques on online social media
Table 3 Depression detection using unsupervised machine learning techniques on online social media
Table 4 Depression detection using traditional deep learning techniques on online social media
Table 5 Depression detection using attention networks with transformers on online social media

The goal of depression detection is to create a predictive model that can quickly identify textual information related to mental health issues and identify persons with depression from tweets of Twitter users. Using a regular expression or stream of real-time tweets made up of 3682 individuals, 1983 of whom self-declared having depression and 1699 of whom did not were used in this work. To recognize people with depression and draw attention to postings pertaining to the author's mental health, two multiple-instance learning models (MIL)—one with and one without an anaphoric resolution encoder—were created. Anaphora resolution is a text analysis problem that focuses on identifying which person is referenced in which textual context. In this paper, the authors use the MIL approach to create two models: MIL-SocNet, which is multiple-instance learning for social networks, and (MILA-SocNet), which is multiple-instance learning for social networks using anaphora resolution, to identify users who are depressed and emphasize posts that have been written on the user's issue of mental health. Instead of a document vector, both models employ new document segment encoding, a tweet encoder, and user representation. The performance is further enhanced by the inclusion of the anaphora resolution in the latter model. The anaphoric resolution model achieved 92% accuracy, 92% F1-score, and 90% area under the curve (AUC) at its best. The model's prediction abilities were superior to those of both traditional machine learning and deep learning alternatives (Wongkoblap et al., 2018).

User-generated information from Twitter can be used to examine the dynamics of depression in communities affected by the COVID-19 outbreak. To construct depression classification models, the authors present a novel method based on multimodal characteristics extracted from tweets and term frequency-inverse document frequency (TF-IDF). Multimodal characteristics capture depression indications from affective, topical, and disciplinary angles by analyzing recently scraped tweets from New South Wales, Australia, residents. During the COVID-19 timeframe, this unique classification approach can extract depression polarities that may be influenced by COVID-19 and related events. The results showed that after the COVID-19 epidemic, people's levels of depression increased. State lockdown and other government interventions contributed to an already depressing atmosphere. The LDA model was used to classify these tweets and was compared with other models also (Zhou et al. 2021).

The paper by Naseem et al. focuses on the application of personalized mental health interventions using natural language processing (NLP) and attention-based in-depth entropy active learning. The objective of this research is to increase the trainable instances using a semantic clustering mechanism. For this purpose, the authors proposed a method based on synonym expansion by semantic vectors. Semantic vectors based on semantic information derived from the context in which it appears are clustered. The resulting similarity metrics help to select the subset of unlabeled text by using semantic information. The proposed method separates unlabeled text and includes it in the next active learning mechanism cycle. The method updates model training by using the new training points. The bidirectional long short-term memory (LSTM) architecture with an attention mechanism achieved 0.85 receiver operating characteristic (ROC curve) on the blind test set. The learned embedding is then used to visualize the activated word’s contribution to each symptom and find the psychiatrist’s qualitative agreement (Naseem et al. 2022).

A novel model, explainable multi-aspect depression detection with hierarchical attention network (MDHAN), to automatically identify depressed people on social media and to provide an explanation for the model's predictions is proposed. The authors considered user’s posts that have been enhanced with extra Twitter features. In particular, the model computed the importance of each tweet and word, encoded user postings using two levels of attention mechanisms applied at the tweet level and word level, and extracted semantic sequence features from user timelines (posts). This hierarchical attention model was created in a way that it can identify patterns that result in incomprehensible findings. The tests reveal that MDHAN beats a number of well-known and reliable baseline techniques, illuminating the potency of fusing deep learning with multi-aspect information. Additionally, it is also demonstrated how this algorithm enhances predictive performance when identifying depression in people who openly post messages on social media. MDHAN performs exceptionally well and guarantees that there are enough data to support the prediction. The model performs the best in comparison with all the other state-of-the-art models and achieved the highest accuracy, precision, recall, and F1-score (Zogan et al. 2022).

4.2 Schizophrenia

Schizophrenia is a severe mental illness in which reality is perceived by sufferers strangely. Schizophrenia may include hallucinations, delusions, and severely irrational thinking and behavior, which can make it difficult to go about daily activities and be incapacitating. Schizophrenia patients require ongoing care. Early intervention may help keep symptoms under control before major issues arise and may enhance the prognosis in the long run (Schizophrenia, 2020). The study focusing on detecting schizophrenia using online social media is presented in Table 6. The purpose of this study is to investigate whether social media user writings can be utilized to detect indicators of schizophrenia using machine learning. For the control group, the authors gathered postings from the social media site Reddit that discussed schizophrenia as well as those about fitness, humor, meditation, parenthood, relationships, and teaching and identified linguistic markers of schizophrenia by classifying posts as belonging to schizophrenia using supervised machine learning and analyzing significant aspects. For the purpose of identifying a cohesive semantic representation of words in schizophrenia, an unsupervised clustering algorithm was applied to the features. The greater usage of third-person on plural pronouns, words that express negative emotions, and topics relating to symptoms are only a few of the linguistic traits, and topics were found to be significantly different. The accuracy achieved is 96% (Bae et al. 2021).

Table 6 Schizophrenia detection using machine learning techniques on online social media

4.3 Psychopath

A psychopath is defined as an individual with an egotistical and antisocial disposition who lacks regret for their actions, lacks empathy for others, and frequently exhibits criminal tendencies. Instead, it is a colloquial word frequently applied to the disease known as antisocial personality disorder (ASPD) (Psychopathy 2023). During our study, we came across a few studies detecting psychopaths on online social media, as shown in Tables 7 and 8, respectively.

Table 7 Psychopath detection using machine learning technique on online social media
Table 8 Psychopath detection using deep learning technique on online social media

The majority of the work that has hitherto been done on psychopath detection has been done in the psychology field using conventional methods, such as the SRPIII technique with small dataset sizes. This encourages to develop a sophisticated computational model for psychopath diagnosis in the field of text analytics. In this study, attention-based Bi-LSTM for psychopath detection with a larger dataset size is investigated for its effectiveness in classifying input text into a psychopath and non-psychopath categories (Asghar et al. 2021).

4.4 Suicide

Suicide is the deliberate act of bringing about one's own death. When someone hurts oneself with the intent of ending their life, but does not die as a consequence of their acts, it is considered a suicide attempt. Numerous factors both enhance and decrease the chance of suicide. There is a link between suicide and other types of harm and violence. People who have experienced violence, such as child abuse, bullying, or sexual violence, for instance, are more likely to commit suicide. Suicidal thoughts and behaviors can be reduced by having simple access to health care, connections to family and community support, and several other factors. The suicide rate surged by 30% between 2000 and 2018, then fell in 2019 and 2020. With 45,979 deaths from suicide in 2020, it will be the third greatest cause of mortality in the US. Approximately one death occurs every 11 min. Even more, people contemplate suicide or make an attempt at it. According to estimates, 12.2 million American people considered suicide seriously in 2020, 3.2 million made plans to commit suicide, and 1.2 million actually succeeded in doing so (Facts about suicide 2023). There are multiple studies available for suicide detection using online social media. For ease of understanding, we have separated the studies of detecting suicide using machine and deep learning. Tables 9 and 10 focus on studies using supervised and unsupervised machine learning techniques, respectively, while Table 10 focuses on suicide detection on online social media using deep learning (Z Li 2022).

Table 9 Suicide detection using supervised machine learning techniques on online social media
Table 10 Suicide detection using unsupervised machine learning technique on online social media

Social media data analysis using machine learning offers a viable method for identifying long-term contextual factors that increase a person's risk of having suicidal thoughts and actions. The goal was to create the ‘Suicide Artificial Intelligence Prediction Heuristic (SAIPH)’ algorithm, which analyzes publically available Twitter data to forecast future risks of suicide thinking against psychological factors linked to suicide, such as burden, stress, loneliness, hopelessness, sleeplessness, sadness, and anxiety, the authors trained a number of neural networks, aid to help with suicide screening and risk monitoring, and have the ability to identify a person's future suicide ideation (SI) risk. The data are fed into random forest models to identify the individuals who are at a risk of suicide ideation (SI). An AUC of 88% was produced utilizing tweet data from at least 1 day before the case individuals' declaration of SI using a series of 10 bootstrap aggregated random forest models that included neural network model scores and a training and test set of roughly equal sizes. Importantly, the range of AUC values obtained using data from 3 weeks' worth of days within the 6 months prior to the SI event averaged an AUC of about 0.8, indicating that this method is effective for identifying people at risk for suicidal ideation who have not yet expressed such thoughts (Roy et al. 2020) (Table 11).

Table 11 Suicide detection using deep learning technique on online social media

Artificial neural network (ANN) models were developed in this study to forecast suicide risk using the common language of social media users. The dataset contained legitimate psychological data about the users as well as 83,292 posts written by 1002 verified Facebook users. A single-task model (STM) to predict suicide risk from Facebook postings directly (Facebook texts—suicide) and a multi-task model (MTM), which included hierarchical, multilayered sets of theory-driven risk factors (Facebook texts—personality traits–psychosocial risks–psychiatric disorders–suicide), were both built using deep contextualized word embeddings for text representation. The MTM achieved much better prediction accuracy when compared to the STM predictions (0.697 AUC 0.746), with significantly bigger effect sizes (0.729 d 0.936) (Ophir et al. 2020).

4.5 Stress

Any form of change that causes physical, mental, or psychological strain on a person is considered to be stressful. Your body's reaction to anything that demands attention or action is stress. Everyone experiences moments of stress. However, how you tackle stress has a significant impact on your overall well-being (Stress 2022). Stress is a state of tension, either emotionally or physically. Any circumstance or idea that gives you cause for annoyance, rage, or anxiety can trigger it. The body’s response to a demand or challenge is stress. Stress can occasionally be advantageous, such as when it keeps a person safe or helps accomplish a deadline. However, chronic stress can be bad for a person’s health (Li N, 2023).

We discovered two studies focusing on stress detection on online social media using deep learning and a study on machine learning which are presented in Tables 12 and 13, respectively.

Table 12 Stress detection using machine learning technique on online social media
Table 13 Stress detection using deep learning techniques on online social media

Text analysis has been demonstrated to be useful in the diagnosis of mental illness, emotions, and sentiment. However, the current state of the art in stress identification from text is corpus-specific. Good, well-validated approaches that work across several datasets are currently in short supply. Munaz et al. proposed a method to detect stress in textual data and evaluate it using numerous publicly available English datasets, with the goal of advancing the state of the art in this area. In order to improve classification accuracy, the proposed method blends lexicon-based characteristics with distributional representations. Additionally, three distinct word embedding methods for making use of distributional representation are investigated. Three machine learning models were used to implement this method, and their performance was assessed by F1-score. This analysis serves as a starting point for future studies, and the results show that the best model, with F1-score over 80%, combines FastText embeddings with a subset of lexicon-based features (Munaz and Iglesias, 2022) as mentioned in Table 12.

4.6 Borderline personality and bipolar disorder

Borderline personality disorder affects how you perceive and feel about yourself and other people, making it difficult to function in daily life. Issues with one's self-image, trouble controlling one's emotions and conduct, and a history of rocky relationships are all included (Cleveland Clinic 2022).

A brain illness called bipolar disorder alters a person's energy, mood, and capability to work. Bipolar disorder patients go through severe emotional crises, or mood episodes, that normally last a few days to a few weeks (Bipolar Disorder, 2022).

We found two studies focusing on borderline and bipolar personality disorders using machine learning only, that are presented in Table 14. Sekulic et al. performed a binary classification task on the social media posts of Reddit for detecting bipolar disorder by gathering interesting linguistic distinctions between individuals with bipolar disorders and the control group revealed by feature analysis, including variations in the use of words that indicate emotions. Recognizing that emotional ups and downs are the primary symptoms of the disorder in the textual clues, the authors examined the emotion-expressive textual qualities in individuals with bipolar disorder and the non-bipolar control group of users using SVM, RF and evaluated them on the different metrics (Sekulic et al. 2018).

Table 14 Borderline personality disorder and bipolar disorder detection using machine learning techniques on online social media

4.7 Self-harm

Self-harm refers to the act of intentionally inflicting pain on oneself as a means of coping with intense emotions, distressing memories, or overwhelming circumstances and situations (Self-harm 2022).

Usually, it is not intended as a suicide attempt. It is an unhealthy approach to deal with emotional anguish, despair, rage, and stress to damage oneself. While self-harm may temporarily relieve physical and emotional stress and create a sense of serenity, it is typically followed by remorse and humiliation as well as the recurrence of unpleasant emotions. Usually, life-threatening injuries are not planned, but more serious and even deadly self-harm is a possibility. Abed Esfahani et al. used transfer learning to detect the early signs of self-harm on the Reddit social media platform and gave up different evaluation metrics (Abed Esfahani et al., 2019).

During our research, we could only get two studies that are presented in Table 15.

Table 15 Self-harm detection using attention networks on online social media

4.8 Anxiety

Anxiety is characterized by apprehension, worry, and restlessness. It may trigger flushing of the skin, agitation, and a racing heart in certain people. It is not unusual for stress to bring up such a response. You may experience anxiety when you have to solve a challenging problem at work, when you have to take a test, or when you have to make a big decision. It may serve as a coping mechanism. It is possible that the feeling of unease will really serve to increase your stamina and mental clarity. The terror is permanent and overwhelming for those who suffer from anxiety disorders (Anxiety, 2020). Table 16 presents studies based on anxiety using online social media.

Table 16 Anxiety detection using machine learning technique on online social media

Figure 4 shows us the total mental health disorder studies in our review. As can be seen clearly, most studies focus on depression alone, followed by suicide. In this chart, we have only focused on single studies. In the next chart, we further elaborate on the studies that focused on more than two studies at a time, as shown in Fig. 5.

Fig. 4
figure 4

Total mental health disorder studies in our review

Fig. 5
figure 5

Total studies in the multiple disorders section

4.9 Multiple disorders

The above studies presented were targeted at only single mental health disorders. In this section, we have shown the studies which identified multiple disorders using online social media. Some of the mental health disorders have been discussed previously, while some others are not.

Anorexia is an eating disorder characterized by a persistent and severe underweight status relative to age and height. Even if they are already underweight, people with this disease may experience a crippling fear of gaining weight. They could be using unhealthy methods to shed pounds, such as excessive dieting or exercise (Anorexia Nervosa 2018).

Experiencing or seeing a scary event might set off the mental health disease known as post-traumatic stress disorder (PTSD). In addition to compulsive, intrusive thoughts about the traumatic incident, symptoms can include flashbacks, nightmares, and anxiety attacks. People who have experienced trauma often have brief periods of difficulty adjusting and coping, but with time and self-care, they typically recover. There is a possibility of post-traumatic stress disorder (PTSD) if the symptoms worsen over time (months or years) and cause significant disruption to daily life (PTSD 2022).

Inattention/hyperactivity disorder (ADHD) is among the most prevalent conditions of childhood neurodevelopment. As a rule, it is first identified in young people and continues throughout adulthood for many (Christiansen et al. 2020). Children with attention-deficit hyperactivity disorder (ADHD) may have difficulties focusing, may act without considering the potential consequences of their actions, or maybe extremely energetic (CDC 2021).

Tables 17, 18, and 19 present the studies focusing on multiple disorder identification using machine and deep learning on online social media, respectively.

Table 17 Multiple disorders detection using machine learning technique on online social media
Table 18 Multiple disorders detection using deep learning technique on online social media
Table 19 Multiple disorders detection using attention networks on online social media

In the current study, the authors examined whether there is enough signal in people's ordinary language to forecast the future. Language samples were gathered from posts to discussion groups concentrating on various mental illnesses (clinical subreddits) as well as postings to discussion groups focusing on nonmental health subjects (nonclinical subreddits) on the social media platform Reddit. Finally, models trained to predict future mental illness learned to focus on words indicating life stress while models trained on clinical subreddits learned to focus on words indicating disorder-specific symptoms, suggesting that the features that are predictive of mental illness may change over time. Classification models were evaluated using precision, recall, and accuracy, and clustering was performed to identify the most used words in these subreddits (Thorstad and Wolff 2019).

Zeberga et al. proposed a novel methodology for identifying depression and anxiety-related posts using bidirectional encoder representations from transformers (BERT) while preserving the contextual and semantic meaning of the words used across the entire corpus. To further improve performance and accuracy, a knowledge distillation methodology, a relatively new method for transferring information learned by a big pre-trained model (BERT) to a smaller one, was introduced. The authors developed a methodology for gathering information from the most popular social media platforms, such as Reddit and Twitter. Finally, word2vec and BERT with Bi-LSTM are used to analyze social media posts for indicators of depression and anxiety. When compared to other state-of-the-art technologies, the system achieved 98% accuracy employing the knowledge distillation process (Zeberga et al. 2022).

In this section, more than one disorder is used in the social media posts for the classification or clustering task. In this chart also, the majority of the studies are focused on depression, followed by anxiety, anorexia, self-harm, suicide, and autism, etc. This chart represents the total studies in the multiple disorders section alone as shown in Fig. 5.

After, reviewing all the studies, we have tried to present the total number studies which we found in different years. As we can clearly see from the chart in Fig. 6, that the studies on mental are maximum in the year 2022 according to our review. There is a sudden rise in the number of studies after 2020 may be because of the sudden rise in mental cases because of the consequences of lockdown in different parts of the world.

Fig. 6
figure 6

Total number of studies covered under our review study in different publication years using stacked area chart

5 Limitations of using online social media

It can be observed that promising results are obtained while using online social media for mental health disorder detection using ML and DL techniques. But there are various challenges with the use of social media data that need to be resolved. Some of the key challenges are as follows:

5.1 Faulty research ethics

There are no ethical guidelines available for addressing the unique challenges of working with the data on social media. Because of this, scientists and academicians have little direction in addressing the ethical, legal, and social issues of social media data. The ethical issues encountered while using the social media data are not addressed in the guidelines given by these federal institutes, as the scientists and the review board members are unaware of all the ethical, social, and legal implications of using social media data. The users who have made their profiles and data public need not require any ethical clearances, but they may not be aware of the way their data are being used, and their identities can be traced back, which could cause them harm. Most of the time, the user agreements made are very lengthy and detailed, which addresses all the complications and guidelines for users. Still, users do not read them fully and generally agree to them without realizing how their data will be used. IBM’s Watson for Oncology kept Watson’s unsafe and incorrect suggestions secret for more than a year for cancer patients as the system was trained on a few synthetic cancer cases from the Memorial Sloan Kettering (MSK) Cancer Center by its doctors (Chen 2018). There are some academic groups available, like ReCODE Health, which enable resource sharing and take the responsibility of educating the general public about their rights with respect to social media. Researchers should notify about the process used for data collection, storage criteria, and how and what information they have used (Brown 2018).

5.2 Approach to social media data

Retrieving social media is restricted which includes publicly available data because of the continuous change in the data access rules. Previously, a whistleblower revealed the privacy breaches in Facebook and Instagram, which made these giants change their application programming interfaces (APIs) to limit data access by third-party applications. Confining the data access appears to be a convincing means but this has a great impact on how the data can be accessed favorably by the general public. This continual change in the data access policies forces researchers to acquire data from third-party applications by paying exorbitant prices. These applications add layers of privacy breaches. There have been multiple reports suggesting the compromise of research when the data access policies changed during a research study pressurizing the researchers to redevelop the methods and techniques mid-way, ultimately degrading the quality of research standards. The Twitter Academic Research API was made for research purposes and was free for academicians, but when Elon Musk acquired Twitter, he made the API paid on February 27, 2023, which posed many problems for the researchers who were in the middle of their data collection process (Developer terms, 2023). Recently, Facebook has partnered with Social Science One, which has facilitated the relationship between industry and academia to solve the challenges encountered while accessing the data, such as privacy, content, and trade secrets. This venture has allowed researchers to use Facebook data for how it influences democracy. Facebook partnered with Social Science One to allow scientists to access Facebook data to study how social media influences democracy.

5.3 Absence of collaborative academic research

Looking at the proliferation of social media, interdisciplinary fields should be developed to improve scientific research to bring the different communities simultaneously. The researchers in different academic fields are unaware of different works in the cross-referenced academic fields like diabetes prediction using machine learning is the work of medicine as well as engineering. Still, there is little awareness among researchers to collaborate with each other so that they come up with better results. This lack of merging of different scientific studies disseminated the studies across different journals and conferences, which led to researchers not getting enough of what could be implemented by having an interdisciplinary approach. Scientific networking programs and transdisciplinary training will help researchers flourish in their fields. Health training programs can offer courses on machine learning, natural language processing, data analytics, and health-care analytics which will allow clinicians and computer engineers to learn and understand the basic concepts needed to implement transdisciplinary research.

5.4 Availability and correctness of social media data

One major problem encountered while using online social media for mental health prediction is accessing correct labeled data. Although collecting social media data is easy as compared to surveys and questionnaires, getting appropriate data is difficult because of different user writing styles. Manual labeling of social media data is very time-consuming and has to be performed by professionals with proper consensus. Nowadays, social media giants like Facebook have increased measures to protect the privacy of users by making all the content of the profile private. These privacy features hamper the data collection process as such content won’t be accessed by the APIs while extracting the online social media data (Jain 2020).

6 Conclusion

The main purpose of this study is to provide a rundown of the state-of-the-art research on machine and deep learning approaches used for predicting multiple mental health disorders using online social media data. Moreover, the review can be helpful for researchers in formulating models based on the severity levels of mental health disorders in real-time for the users on online social media. Although the reliability of online social media is not guaranteed, the data should be properly analyzed and the privacy of the users should not be compromised. Even though online social media comes with methodological and technical difficulties for predictive modeling, social media is still a valuable source for identifying the characteristics of individuals vulnerable to mental health disorders. Moreover, the COVID-19 pandemic has also worsened the mental health of individuals, and social media has become a savior for them (Khasnis et al. 2021). Despite various difficulties on online social media, this field helps in providing rapid tools and techniques to mitigate future risks. Furthermore, the review focused on the ideas adopted by different researchers by providing a summary of the dataset, techniques applied, evaluation metrics used, type of features used, and the type of classification or clustering applied. However, social media text is comprised of varying writing styles and unstructured text, but natural language processing and machine learning techniques are widely used for the analysis of such text. On the basis of this review work, we suggest that natural language processing and machine learning approaches could be the vehicle for translating big online social media data into improved human health. Furthermore, we also focused on the limitations encountered while using online social media for research purposes. As a major concern, this study also outlines the research gap while reviewing the papers. The research gap should be overcome to bring up more studies in the future. A very interesting fact to notice is that the research related to mental health has doubled in the year 2020–2022. We could gather a lot of research published in these years. The major reason for this rise could be the COVID-19 pandemic which affected individuals mentally and physically. The lockdown put a mental strain on the majority of the individuals because of loneliness, loss of loved ones, job loss, and several other reasons. The lockdowns also increased the use of online social media, letting users share their emotions on these platforms.

7 Future work

Data collection and analysis tools such as sentiment analysis and opinion mining have been widely available due to recent technological developments. As it stands, reliance on technology has advantages and disadvantages. The entire information sector would benefit from an internet-based framework that can be accessed from anywhere by anyone looking for reliable data and therapeutic guidelines on mental health. The research proposal is an interdisciplinary exploration of how digital natives' mental health affects their online behaviors. Thus, it pulls from psychology and computer science to investigate how far open-source content from online social media may be mined for clues toward the early diagnosis of mental illness in individuals.

Academics can analyze the static data on a forum to determine if it contains depressed material, according to recent studies. To collect more dynamic data in diagnosing mental illnesses, however, it is now time to combine forum users with conversational AI. Because people are more likely to open up and share personal details about their experiences with mental health when they know they are being anonymous online, it is important to consider how technology and mental health intersect when trying to understand the data. While it is not the same as having a trained professional on your side, having a strong social network behind you is a great first line of defense. All these things might be the foundation for learning more about mental health on online social media. People in today's fast-paced world use the internet to research their mental, emotional, and social health to gain an edge in the workplace. Finding big amounts of textual data in the medical field can be challenging, but it is important to study how to extract web data related to human psychology. Because of the progress made in ML, deep learning approaches can now deal with text corpora of different sizes throughout time. That is why it is important to look into using deep learning to evaluate textual features in real-time. To learn from an interactive environment, a deep reinforcement learning agent can try out different forms of feedback based on their own prior experiences. Therefore, better results can be produced by combining reinforcement learning with deep learning to identify the severity of mental conditions based on social media posts. Transfer learning and attention networks can also help analyze these patterns. Most of the research we came across only targeted the English language, but in a country like India, where multiple languages are spoken along with English, these data could not completely determine populations like this. So multilingual and bilingual areas for this research should be explored by the researchers as many online social media are available in multiple languages. The researchers can also focus on categorizing the mental health status of individuals depending on factors such as geographical area, profession, etc., as we could not discover any paper which has classified the mental health state of individuals focusing on such factors. These factors could provide us a better insight into, let’s say, which profession is mostly affected by mental health. This research could help psychologists find new areas of study for why a particular group is affected and how to tackle these people.