pnpl.datasets.clinical_communication.dataset.ClinicalCommunication

pnpl.datasets.clinical_communication.dataset.ClinicalCommunication#

class pnpl.datasets.clinical_communication.dataset.ClinicalCommunication(data_path, partition='train', *, k=5, test_sentences=100, unit='word', cache_path=None, download=True)[source]#

Load the exact single-subject LibriBrain clinical benchmark.

Train/val default to individual words from the original recording split. Use unit=”sentence” for natural sentence windows, or unit=”group” for the original disjoint five-occurrence training/validation groups. Test/dev always return constructed clinical sentences.

k selects the first k of five frozen donors, without replacement, resampling, averaging, or reordering. It applies to test/dev and groups; natural words/sentences have one occurrence per word. Test defaults to the original 100 sentences; test_sentences=200 adds the extension. partition=”dev” provides 50 development sentences from val recordings.

Every item is a dict with meg, words, sentence, sentence_id, occurrences, and positions. MEG shapes:

word: (306, 150); group: (k, 306, 150); natural sentence: (words, 306, 150); clinical sentence: (words, k, 306, 150).

Words are strings, with no model-specific target embeddings. Variable-length sentences need a custom collate function (or batch_size=None). metadata(index) inspects exact donor identities without recording I/O.

Downloads use pinned revisions and preprocessing is cached per recording. download=False uses local sources/cache only. Construction never downloads.

__init__(data_path, partition='train', *, k=5, test_sentences=100, unit='word', cache_path=None, download=True)[source]#

Methods

__init__(data_path[, partition, k, ...])

close()

metadata(index)

Return portable source paths, event row IDs and exact donor order.

prepare()

Download/preprocess only recordings used by this dataset view.