Datasets:
Update depression-reddit-cleaned.py
Browse files
depression-reddit-cleaned.py
CHANGED
|
@@ -15,9 +15,9 @@ from datasets.tasks import TextClassification
|
|
| 15 |
|
| 16 |
_DESCRIPTION = """\
|
| 17 |
The dataset provided is a Depression: Reddit Dataset (Cleaned)containing approximately
|
| 18 |
-
7,000 labeled instances. It consists of two main features: '
|
| 19 |
-
The '
|
| 20 |
-
the '
|
| 21 |
|
| 22 |
The raw data for this dataset was collected by web scraping Subreddits. To ensure the data's
|
| 23 |
quality and usefulness, multiple natural language processing (NLP) techniques were applied
|
|
@@ -46,14 +46,14 @@ class DepressionRedditCleaned(datasets.GeneratorBasedBuilder):
|
|
| 46 |
description=_DESCRIPTION,
|
| 47 |
features=datasets.Features(
|
| 48 |
{
|
| 49 |
-
"
|
| 50 |
-
"
|
| 51 |
num_classes=2,
|
| 52 |
names=["not_depression", "depression"]
|
| 53 |
)
|
| 54 |
}
|
| 55 |
),
|
| 56 |
-
task_templates=[TextClassification(text_column="
|
| 57 |
)
|
| 58 |
|
| 59 |
def _split_generators(self, dl_manager):
|
|
@@ -72,5 +72,5 @@ class DepressionRedditCleaned(datasets.GeneratorBasedBuilder):
|
|
| 72 |
# call next to skip header
|
| 73 |
next(csv_reader)
|
| 74 |
for id_, row in enumerate(csv_reader):
|
| 75 |
-
|
| 76 |
-
yield id_, {"
|
|
|
|
| 15 |
|
| 16 |
_DESCRIPTION = """\
|
| 17 |
The dataset provided is a Depression: Reddit Dataset (Cleaned)containing approximately
|
| 18 |
+
7,000 labeled instances. It consists of two main features: 'text' and 'label'.
|
| 19 |
+
The 'text' feature contains the text data from Reddit posts related to depression, while
|
| 20 |
+
the 'label' feature indicates whether a post is classified as depression or not.
|
| 21 |
|
| 22 |
The raw data for this dataset was collected by web scraping Subreddits. To ensure the data's
|
| 23 |
quality and usefulness, multiple natural language processing (NLP) techniques were applied
|
|
|
|
| 46 |
description=_DESCRIPTION,
|
| 47 |
features=datasets.Features(
|
| 48 |
{
|
| 49 |
+
"text": datasets.Value("string"),
|
| 50 |
+
"label": datasets.features.ClassLabel(
|
| 51 |
num_classes=2,
|
| 52 |
names=["not_depression", "depression"]
|
| 53 |
)
|
| 54 |
}
|
| 55 |
),
|
| 56 |
+
task_templates=[TextClassification(text_column="text", label_column="label")]
|
| 57 |
)
|
| 58 |
|
| 59 |
def _split_generators(self, dl_manager):
|
|
|
|
| 72 |
# call next to skip header
|
| 73 |
next(csv_reader)
|
| 74 |
for id_, row in enumerate(csv_reader):
|
| 75 |
+
text, label = row
|
| 76 |
+
yield id_, {"text": text, "label": label}
|