## 2 Materials and Methods
### Deep Learning Model for Classification of Mental Health Disorders
#### 2.2.1 Dataset Construction
As a result, it is limited to a small subset of subreddits, specifically five, encompassing only three different diagnoses (anxiety, depression, and bipolar). Our goal is to significantly increase the number of SubReddits analyzed, thus creating a much larger dataset than that of MentalBert. Our dataset comprises 30,972,717 sentences, a substantial increase compared to MentalBert's 13,671,785 sentences. In addition, we have broadened our scope beyond the original Reddit dataset by integrating additional data sources. This expansion is crucial in building a more comprehensive and clinically relevant training set. Our dataset encompasses a wide spectrum of the DSM-V diagnostic categories, enhancing the ability of the model to recognize and categorize a diverse array of mental health disorders. To achieve this, we first aggregated posts from subreddits including BPD, BipolarSOs, BipolarReddit, bipolar, schizophrenia, Anxiety, depression, selfharm, StopSelfHarm, SuicideWatch, addiction, cripplingalcoholism, OpiatesRecovery, opiates, autism, and mental health, spanning the period from 2005 to 2021. Some examples of the extracted posts are shown in Table 2.  
We expand this initial dataset with other symptom descriptions from internet data sources, mainly Psychforums, but also Psychology Today, Medline, and Mayo Clinic, among others. The topics covered in these new data sources range from specific mental health disorders to therapy, medication, and overall support. In contrast to Reddit, PsychForums organizes its subforums according to diagnostic categories defined in the DSM, which are further broken down into more specific diagnoses. For example, the Anxiety Disorders subforum includes specific sections like Agoraphobia, Social Phobia, and Generalized Anxiety Disorder. To further enrich our dataset with examples of less common conditions, we obtained condition descriptions and symptoms from specialized databases such as PsychologyToday and the other sources described. We enhanced these samples by simulating symptom variations and modifying the phrasing using back-translation techniques. This method allowed us to create a more robust and diverse dataset, encompassing a wide array of mental health disorders. By combining Reddit examples with examples from other internet sources, we are able to construct a dataset that is both large, enabling the training of modern large language models, and extensive in coverage of conditions, thereby reducing the bias of the original Reddit dataset that is skewed towards more common conditions. Our new dataset includes conditions in the following DSM-V diagnostic categories: Neurodevelopmental Disorders; Schizophrenia Spectrum and Other Psychotic Disorders; Depressive Disorders; Anxiety Disorders; Trauma and Stressor-Related Disorders; Dissociative Disorders; Somatic Symptom and Related Disorders; Feeding and Eating Disorders; Sleep-Wake Disorders; Sexual Dysfunctions; Disruptive, Impulse-Control, and Conduct Disorders; Substance-Related and Addictive Disorders; Neurocognitive Disorders; and Personality Disorders. After conducting preprocessing and data cleaning, we amassed 2,480,600 data points. We used the resulting dataset to pretrain a transformer-based deep learning model, specifically BERT, which is described in the next section.