|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"""TODO: Add a description here.""" |
|
|
|
|
|
import csv |
|
import json |
|
import os |
|
|
|
import datasets |
|
|
|
|
|
_CITATION = """\ |
|
@inproceedings{milintsevich-etal-2024-model, |
|
title = "Your Model Is Not Predicting Depression Well And That Is Why: A Case Study of {PRIMATE} Dataset", |
|
author = {Milintsevich, Kirill and Sirts, Kairit and Dias, Ga{\"e}l}, |
|
booktitle = "Proceedings of the 9th Workshop on Computational Linguistics and Clinical Psychology (CLPsych 2024)", |
|
month = mar, |
|
year = "2024", |
|
address = "St. Julians, Malta", |
|
publisher = "Association for Computational Linguistics", |
|
url = "https://aclanthology.org/2024.clpsych-1.13", |
|
pages = "166--171", |
|
} |
|
""" |
|
|
|
_DESCRIPTION = """\ |
|
Focusing on the PRIMATE dataset, our study reveals concerns regarding annotation validity, particularly for the lack of interest or pleasure symptom. Through re-annotation by a mental health professional, we introduce finer labels and textual spans as evidence, identifying a notable number of false positives. Our refined annotations offer a higher-quality test set for anhedonia detection. This study underscores the necessity of addressing annotation quality issues in mental health datasets, advocating for improved methodologies to enhance NLP model reliability in mental health assessments. |
|
""" |
|
|
|
|
|
_HOMEPAGE = "" |
|
|
|
|
|
_LICENSE = "" |
|
|
|
_URL = "reddit-anhedonia.json" |
|
|
|
|
|
|
|
class RedditAnhedonia(datasets.GeneratorBasedBuilder): |
|
"""Reddit posts annotated for presence or absence of anhedonia.""" |
|
|
|
VERSION = datasets.Version("1.1.0") |
|
|
|
def _info(self): |
|
features = datasets.Features( |
|
{ |
|
"primate_id": datasets.Value("int64"), |
|
"answerable": datasets.ClassLabel(num_classes=2, names=["not answerable", "answerable"]), |
|
"mentioned": datasets.ClassLabel(num_classes=2, names=["not mentioned", "mentioned"]), |
|
"writer_symptom": datasets.ClassLabel(num_classes=2, names=["writer's symptom", "not writer's symptom"]), |
|
"quote": datasets.Sequence(feature=datasets.Sequence(datasets.Value(dtype='int64', id=None), length=-1, id=None), length=-1, id=None) |
|
} |
|
) |
|
return datasets.DatasetInfo( |
|
description=_DESCRIPTION, |
|
features=features, |
|
homepage=_HOMEPAGE, |
|
license=_LICENSE, |
|
citation=_CITATION, |
|
) |
|
|
|
def _split_generators(self, dl_manager): |
|
data_dir = dl_manager.download(_URL) |
|
return [ |
|
datasets.SplitGenerator( |
|
name=datasets.Split.TEST, |
|
|
|
gen_kwargs={ |
|
"filepath": data_dir, |
|
}, |
|
), |
|
] |
|
|
|
|
|
def _generate_examples(self, filepath): |
|
with open(filepath, encoding="utf-8") as f: |
|
data = json.load(f) |
|
for idx, sample in enumerate(data): |
|
yield idx, { |
|
"primate_id": sample["primate_id"], |
|
"answerable": sample["answerable"], |
|
"mentioned": sample["mentioned"], |
|
"writer_symptom": sample["writer_symptom"], |
|
"quote": sample["quote"], |
|
} |