ihsansaad24 ourafla commited on
Commit
105abfc
·
verified ·
0 Parent(s):

Duplicate from ourafla/Mental-Health_Text-Classification_Dataset

Browse files

Co-authored-by: Priyangshu Mukherjee <ourafla@users.noreply.huggingface.co>

.gitattributes ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.lz4 filter=lfs diff=lfs merge=lfs -text
12
+ *.mds filter=lfs diff=lfs merge=lfs -text
13
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
14
+ *.model filter=lfs diff=lfs merge=lfs -text
15
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
16
+ *.npy filter=lfs diff=lfs merge=lfs -text
17
+ *.npz filter=lfs diff=lfs merge=lfs -text
18
+ *.onnx filter=lfs diff=lfs merge=lfs -text
19
+ *.ot filter=lfs diff=lfs merge=lfs -text
20
+ *.parquet filter=lfs diff=lfs merge=lfs -text
21
+ *.pb filter=lfs diff=lfs merge=lfs -text
22
+ *.pickle filter=lfs diff=lfs merge=lfs -text
23
+ *.pkl filter=lfs diff=lfs merge=lfs -text
24
+ *.pt filter=lfs diff=lfs merge=lfs -text
25
+ *.pth filter=lfs diff=lfs merge=lfs -text
26
+ *.rar filter=lfs diff=lfs merge=lfs -text
27
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
28
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
29
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
30
+ *.tar filter=lfs diff=lfs merge=lfs -text
31
+ *.tflite filter=lfs diff=lfs merge=lfs -text
32
+ *.tgz filter=lfs diff=lfs merge=lfs -text
33
+ *.wasm filter=lfs diff=lfs merge=lfs -text
34
+ *.xz filter=lfs diff=lfs merge=lfs -text
35
+ *.zip filter=lfs diff=lfs merge=lfs -text
36
+ *.zst filter=lfs diff=lfs merge=lfs -text
37
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
38
+ # Audio files - uncompressed
39
+ *.pcm filter=lfs diff=lfs merge=lfs -text
40
+ *.sam filter=lfs diff=lfs merge=lfs -text
41
+ *.raw filter=lfs diff=lfs merge=lfs -text
42
+ # Audio files - compressed
43
+ *.aac filter=lfs diff=lfs merge=lfs -text
44
+ *.flac filter=lfs diff=lfs merge=lfs -text
45
+ *.mp3 filter=lfs diff=lfs merge=lfs -text
46
+ *.ogg filter=lfs diff=lfs merge=lfs -text
47
+ *.wav filter=lfs diff=lfs merge=lfs -text
48
+ # Image files - uncompressed
49
+ *.bmp filter=lfs diff=lfs merge=lfs -text
50
+ *.gif filter=lfs diff=lfs merge=lfs -text
51
+ *.png filter=lfs diff=lfs merge=lfs -text
52
+ *.tiff filter=lfs diff=lfs merge=lfs -text
53
+ # Image files - compressed
54
+ *.jpg filter=lfs diff=lfs merge=lfs -text
55
+ *.jpeg filter=lfs diff=lfs merge=lfs -text
56
+ *.webp filter=lfs diff=lfs merge=lfs -text
57
+ # Video files - compressed
58
+ *.mp4 filter=lfs diff=lfs merge=lfs -text
59
+ *.webm filter=lfs diff=lfs merge=lfs -text
60
+ mental_heath_feature_engineered.csv filter=lfs diff=lfs merge=lfs -text
61
+ mental_heath_unbanlanced.csv filter=lfs diff=lfs merge=lfs -text
62
+ feature.csv filter=lfs diff=lfs merge=lfs -text
63
+ features.csv filter=lfs diff=lfs merge=lfs -text
64
+ train.csv filter=lfs diff=lfs merge=lfs -text
65
+ mental_health_feature_engineered.csv filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ task_categories:
4
+ - text-classification
5
+ language:
6
+ - en
7
+ tags:
8
+ - text
9
+ - nlp
10
+ - classification
11
+ - suicide-prevention
12
+ - depression
13
+ - anxiety
14
+ - tabular
15
+ - mental-health
16
+ pretty_name: Mental Health Text Classification Dataset (4-Class)
17
+ size_categories:
18
+ - 10K<n<100K
19
+ configs:
20
+ - config_name: default
21
+ data_files:
22
+ - split: train
23
+ path: "mental_heath_unbanlanced.csv"
24
+ - split: test
25
+ path: "mental_health_combined_test.csv"
26
+ - split: features
27
+ path: "mental_health_feature_engineered.csv"
28
+ ---
29
+
30
+
31
+ # Mental Health Text Classification Dataset (4-Class)
32
+
33
+ ## Dataset Description
34
+
35
+ This dataset contains short, user‑generated texts labeled for **4‑class mental health classification**: **Suicidal**, **Depression**, **Anxiety**, and **Normal**. It is a **derived dataset** created by combining and cleaning three public mental‑health corpora, then re‑labeling them into a unified 4‑class scheme and exporting CSV files suitable for both classical ML and modern NLP models.
36
+
37
+ The repository includes:
38
+
39
+ - An **unbalanced main training corpus** (realistic class skew).
40
+ - A **strictly balanced test split** for fair evaluation.
41
+ - A **feature‑engineered file** with basic text statistics (length, URLs, emojis, punctuation, etc.).
42
+
43
+ > **Important:** This dataset is intended for **research and education only**. It is not a clinical tool and must not be used for real‑world diagnosis, triage, or crisis intervention.
44
+
45
+ ---
46
+
47
+ ## Dataset Structure
48
+
49
+ ### Files
50
+
51
+ 1. **`mental_heath_unbanlanced.csv`**
52
+ - Main training corpus with **48,945 samples** and a realistic, unbalanced class distribution (Normal, Depression, Suicidal, Anxiety).
53
+ - Columns:
54
+ - `text` – Cleaned post or statement text.
55
+ - `status` – Final label in {`Suicidal`, `Depression`, `Anxiety`, `Normal`}.
56
+
57
+ 2. **`mental_health_combined_test.csv`**
58
+ - **Balanced test split** with **992 samples** (exactly **248 per class**).
59
+ - Columns:
60
+ - `text` – Cleaned post.
61
+ - `status` – Final 4‑class label.
62
+ - Built by combining held‑out data from the sources, applying the same cleaning and label mapping, removing duplicates, and **downsampling each class to equal size** for fair evaluation.
63
+ 3. **`mental_health_feature_engineered.csv`**
64
+ - Cleaned and **feature‑engineered** subset for classical models and analysis.
65
+ - Columns:
66
+ - Core: `Unique_ID`, `text`, `status` (4‑class label).
67
+ - Features:
68
+ - `text_length` – Number of characters.
69
+ - `word_count` – Number of whitespace‑separated tokens.
70
+ - `num_urls` – Count of URL patterns.
71
+ - `num_emojis` – Count of emoji characters.
72
+ - `num_special_chars` – Count of non‑alphanumeric characters.
73
+ - `num_excess_punct` – Count of repeated punctuation sequences (e.g., `!!!`, `???`, `...`).
74
+ - `avg_word_length` – Average characters per word.
75
+
76
+ ### Splits
77
+
78
+ This repo is organized at the **file level** (no HF `train`/`test` config baked in). A common convention is:
79
+
80
+ - `mental_heath_unbanlanced.csv` → `train` (and derive your own validation split).
81
+ - `mental_health_combined_test.csv` → `test`.
82
+
83
+ Example with `datasets`:
84
+
85
+ from datasets import load_dataset
86
+
87
+ ds_train = load_dataset(
88
+ "your-username/Mental-Health_Text-Classification_Dataset",
89
+ data_files={"train": "mental_heath_unbanlanced.csv"},
90
+ )
91
+
92
+ ds_test = load_dataset(
93
+ "your-username/Mental-Health_Text-Classification_Dataset",
94
+ data_files={"test": "mental_health_combined_test.csv"},
95
+ )
96
+
97
+ print(ds_train)
98
+ print(ds_test)
99
+
100
+ text
101
+
102
+ For the feature file:
103
+
104
+ ds_fe = load_dataset(
105
+ "your-username/Mental-Health_Text-Classification_Dataset",
106
+ data_files={"feature": "mental_health_feature_engineered.csv"},
107
+ )
108
+
109
+ text
110
+
111
+ ---
112
+
113
+ ## Source Data and Provenance
114
+
115
+ This dataset does **not** collect new data from individuals. Instead, it is built by **downloading, cleaning, and merging** three existing public resources.[file:64][file:65]
116
+
117
+ **Source datasets:**
118
+
119
+ - **Suicide and Depression Detection (Kaggle)** – Nikhileswar Komati
120
+ Reddit posts from suicide‑related communities labeled as suicidal vs non‑suicidal / depression vs control.
121
+ https://www.kaggle.com/datasets/nikhileswarkomati/suicide-watch
122
+
123
+ - **Sentiment Analysis for Mental Health (Kaggle)** – Suchintika Sarkar
124
+ Short statements labeled as normal, depression, suicide, anxiety, stress, bipolarity, personality disorder, etc.
125
+ https://www.kaggle.com/datasets/suchintikasarkar/sentiment-analysis-for-mental-health
126
+
127
+ - **Reddit Mental Health Classification (Murarka et al.)**
128
+ Dataset released with *“Detection and Classification of Mental Illnesses on Social Media using RoBERTa.”*
129
+ Reddit posts labeled into ADHD, Anxiety, Bipolar, Depression, PTSD, and None.
130
+ https://github.com/amurark/mental-health-detection
131
+
132
+ Only the **processed, relabeled, and re‑split** samples are redistributed here. Users must obtain the original raw data from the links above if needed.
133
+
134
+ ---
135
+
136
+ ## Preprocessing and Label Mapping
137
+
138
+ ### Cleaning
139
+
140
+ All source datasets are passed through a common cleaning pipeline:
141
+
142
+ - Drop rows with missing `text` or labels (`status`).
143
+ - Deduplicate texts across and within sources.
144
+ - Apply regex‑based text normalization (whitespace cleanup, formatting fixes).
145
+ - Filter out extremely short and excessively long texts to remove non‑informative samples.
146
+
147
+ ### Unified 4‑Class Labels
148
+
149
+ Original labels vary widely (suicide vs non, multiple disorders, control). They are mapped to a **four‑class scheme**:
150
+
151
+ - **Suicidal** – Posts explicitly labeled as suicide / suicidal ideation.
152
+ - **Depression** – Posts labeled as depression / depressed.
153
+ - **Anxiety** – Posts labeled with anxiety‑related categories.
154
+ - **Normal** – Control / non‑suicide / normal posts.
155
+
156
+ Samples whose labels cannot be clearly mapped (e.g., stress, bipolar, personality disorder, PTSD, mixed or ambiguous labels) are **discarded** to keep the final label space clean.
157
+
158
+ ### Splits and Balance
159
+
160
+ - The **main training file** (`mental_heath_unbanlanced.csv`) preserves the **natural class imbalance** after cleaning and mapping.
161
+ - The **balanced test file** (`mental_health_combined_test.csv`) is created by:
162
+ - Building a held‑out pool from the sources.
163
+ - Applying the same cleaning and label mapping.
164
+ - Removing duplicates.
165
+ - **Downsampling each class to 248 samples** for a total of 992 rows.
166
+
167
+ The feature‑engineered file is generated from the cleaned sentiment subset by adding the numerical text features listed above.
168
+
169
+ ---
170
+
171
+ ## Intended Uses
172
+
173
+ ### Primary Uses
174
+
175
+ - Research and teaching on **mental‑health‑related text classification**.
176
+ - Benchmarking binary or multi‑class classifiers (especially 4‑class).
177
+ - Studying the impact of **class imbalance**, basic feature engineering, and model robustness on noisy social‑media text.
178
+
179
+ Typical tasks:
180
+
181
+ - 4‑way text classification: Suicidal vs Depression vs Anxiety vs Normal.
182
+ - Ablation studies: raw text vs text + simple features (from the feature‑engineered file).
183
+ - Transfer learning experiments on mental‑health Reddit data.
184
+
185
+ ### Out‑of‑Scope Uses
186
+
187
+ - Clinical decision‑making, diagnosis, or risk assessment.
188
+ - Any deployment that might influence real‑world medical, therapeutic, or crisis‑intervention workflows.
189
+ - Individual‑level profiling, surveillance, or moderation without appropriate human review and safeguards.
190
+
191
+ ---
192
+
193
+ ## Ethical Considerations and Limitations
194
+
195
+ - **Non‑clinical labels:** Labels are derived from subreddit context and dataset creators’ heuristics, not formal diagnoses by clinicians.
196
+ - **Domain bias:** Content is mostly from Reddit and similar platforms; models may not generalize to clinical notes, private messages, or other domains.
197
+ - **Demographic unknowns:** There is no reliable demographic metadata; potential demographic, cultural, or linguistic biases cannot be quantified.
198
+ - **No guarantee of harm‑free samples:** Text may contain distressing content, including mentions of self‑harm or suicide; users should handle and share it with care, especially in teaching settings.
199
+
200
+ Users are encouraged to:
201
+
202
+ - Use this dataset **only in controlled research/educational environments**.
203
+ - Avoid building systems that auto‑label individual users in high‑stakes contexts without expert oversight.
204
+ - Follow your institution’s ethics and IRB/IEC guidelines where applicable.
205
+
206
+ ---
207
+
208
+ ## Citation
209
+
210
+ Please cite the **original datasets** and this derived dataset.
211
+
212
+ **Original datasets**
213
+
214
+ - Komati, N. *Suicide and Depression Detection* \[Dataset\]. Kaggle.
215
+ https://www.kaggle.com/datasets/nikhileswarkomati/suicide-watch
216
+
217
+ - Sarkar, S. *Sentiment Analysis for Mental Health* \[Dataset\]. Kaggle.
218
+ https://www.kaggle.com/datasets/suchintikasarkar/sentiment-analysis-for-mental-health
219
+
220
+ - Murarka, A., Radhakrishnan, B., & Ravichandran, S. (2021). *Detection and Classification of Mental Illnesses on Social Media using RoBERTa* \[Dataset and code\]. GitHub.
221
+ https://github.com/amurark/mental-health-detection
222
+
223
+ **This derived dataset**
224
+
225
+ > Mukherjee, P. (2025). *Mental Health Text Classification Dataset (4‑Class)* \[Dataset\]. Hugging Face Hub. `https://huggingface.co/datasets/ourafla/Mental-Health_Text-Classification_Dataset`.
mental_health_combined_test.csv ADDED
The diff for this file is too large to render. See raw diff
 
mental_health_feature_engineered.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:122f1e702d2971d4c80c90fb3329dfa1485b56e1ccd0f4c5266604299858887e
3
+ size 28519658
mental_heath_unbanlanced.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d41cdc3ec3b8dde8f5553accaccd1a01a59c1440d83d7af6856fab77605c9471
3
+ size 20801685