mrjunos commited on
Commit
fd4339a
·
1 Parent(s): a01db5f

Update depression-reddit-cleaned.py

Browse files
Files changed (1) hide show
  1. depression-reddit-cleaned.py +8 -8
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: 'clean_text' and 'is_depression'.
19
- The 'clean_text' feature contains the text data from Reddit posts related to depression, while
20
- the 'is_depression' 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,14 +46,14 @@ class DepressionRedditCleaned(datasets.GeneratorBasedBuilder):
46
  description=_DESCRIPTION,
47
  features=datasets.Features(
48
  {
49
- "clean_text": datasets.Value("string"),
50
- "is_depression": datasets.features.ClassLabel(
51
  num_classes=2,
52
  names=["not_depression", "depression"]
53
  )
54
  }
55
  ),
56
- task_templates=[TextClassification(text_column="clean_text", label_column="is_depression")]
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
- clean_text, is_depression = row
76
- yield id_, {"clean_text": clean_text, "is_depression": is_depression}
 
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}