VadymV commited on
Commit
4439564
1 Parent(s): abcae73

Convert dataset to Parquet (#4)

Browse files

- Convert dataset to Parquet (d77a99e6499f42dd4e031b0ea0845ccaa69aaa8d)
- Delete data file (7589957123fc6aa686c3ebaee671da717bdf5efc)
- Delete loading script (08a19786ffd04846adf149f6105ec78778156155)
- Delete data file (18754307222ceffa4b92630398e6400c030e5d36)

EEG-semantic-text-relevance.py DELETED
@@ -1,176 +0,0 @@
1
- # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- # TODO: Address all TODOs and remove all explanatory comments
15
- """TODO: Add a description here."""
16
-
17
- import csv
18
-
19
- import datasets
20
- import numpy as np
21
- import pandas as pd
22
-
23
- # TODO: Add BibTeX citation
24
- # Find for instance the citation on arxiv or on the dataset repo/website
25
- _CITATION = """\
26
- @InProceedings{Submitted to NeurIPS 2024,
27
- title = {An EEG dataset of word-level brain responses for
28
- semantic text relevance},
29
- author={Vadym Gryshchuk, Michiel Spapé, Maria Maistro, Christina Lioma,
30
- Tuukka Ruotsalo},
31
- year={2024}
32
- }
33
- """
34
-
35
- # You can copy an official description
36
- _DESCRIPTION = """\
37
- A dataset containing 23,270 time-locked (0.7s) word-level EEG
38
- recordings acquired from 15 participants who read both text that was
39
- semantically relevant and irrelevant to self-selected topics.
40
- """
41
-
42
- _HOMEPAGE = "https://vadymv.github.io/EEG-dataset-for-semantic-text-relevance/"
43
-
44
- _LICENSE = "Apache Licence 2.0"
45
-
46
- _URLS = {
47
- "cleaned": {
48
- "eeg": "./data/cleanedEEG.npy",
49
- "metadata": "./data/metadataForCleanedEEG.pkl"
50
- }
51
- }
52
-
53
-
54
- class EEGSemanticTextRelevance(datasets.GeneratorBasedBuilder):
55
- """
56
- A dataset containing 23,270 time-locked (0.7s) word-level EEG
57
- recordings acquired from 15 participants who read both text that was
58
- semantically relevant and irrelevant to self-selected topics."""
59
-
60
- VERSION = datasets.Version("1.1.0")
61
-
62
- # This is an example of a dataset with multiple configurations.
63
- # If you don't want/need to define several sub-sets in your dataset,
64
- # just remove the BUILDER_CONFIG_CLASS and the BUILDER_CONFIGS attributes.
65
-
66
- # If you need to make complex sub-parts in the datasets with configurable options
67
- # You can create your own builder configuration class to store attribute, inheriting from datasets.BuilderConfig
68
- # BUILDER_CONFIG_CLASS = MyBuilderConfig
69
-
70
- # You will be able to load one or the other configurations in the following list with
71
- # data = datasets.load_dataset('my_dataset', 'first_domain')
72
- # data = datasets.load_dataset('my_dataset', 'second_domain')
73
- BUILDER_CONFIGS = [
74
- datasets.BuilderConfig(name="cleaned", version=VERSION,
75
- description="Load the preprocessed (cleaned) EEG data"),
76
- ]
77
-
78
- DEFAULT_CONFIG_NAME = "cleaned" # It's not mandatory to have a default configuration. Just use one if it make sense.
79
-
80
- def _info(self):
81
- # TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
82
- if self.config.name == "cleaned": # This is the name of the configuration selected in BUILDER_CONFIGS above
83
- features = datasets.Features(
84
- {
85
- "event": datasets.Value("int64"),
86
- "word": datasets.Value("string"),
87
- "topic": datasets.Value("string"),
88
- "selected_topic": datasets.Value("string"),
89
- "semantic_relevance": datasets.Value("int64"),
90
- "interestingness": datasets.Value("int64"),
91
- "pre-knowledge": datasets.Value("int64"),
92
- "sentence_number": datasets.Value("int64"),
93
- "participant": datasets.Value("string"),
94
- "eeg": datasets.Array2D(shape=(32, 2001), dtype="float64"),
95
- # These are the features of your dataset like images, labels ...
96
- }
97
- )
98
- else: # This is an example to show how to have different features for "first_domain" and "second_domain"
99
- raise ValueError("Not implemented.")
100
-
101
- return datasets.DatasetInfo(
102
- # This is the description that will appear on the datasets page.
103
- description=_DESCRIPTION,
104
- # This defines the different columns of the dataset and their types
105
- features=features,
106
- # Here we define them above because they are different between the two configurations
107
- # If there's a common (input, target) tuple from the features, uncomment supervised_keys line below and
108
- # specify them. They'll be used if as_supervised=True in builder.as_dataset.
109
- # supervised_keys=("sentence", "label"),
110
- # Homepage of the dataset for documentation
111
- homepage=_HOMEPAGE,
112
- # License for the dataset if available
113
- license=_LICENSE,
114
- # Citation for the dataset
115
- citation=_CITATION,
116
- )
117
-
118
- def _split_generators(self, dl_manager):
119
- # TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration
120
- # If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
121
-
122
- # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
123
- # It can accept any type or nested list/dict and will give back the same structure with the url replaced with path to local files.
124
- # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
125
- urls = _URLS[self.config.name]
126
- # data_dir = dl_manager.download_and_extract(urls)
127
- return [
128
- datasets.SplitGenerator(
129
- name=datasets.Split.TRAIN,
130
- # These kwargs will be passed to _generate_examples
131
- gen_kwargs={
132
- "filepath_eeg": urls["eeg"],
133
- "filepath_metadata": urls["metadata"],
134
- },
135
- ),
136
- # datasets.SplitGenerator(
137
- # name=datasets.Split.VALIDATION,
138
- # # These kwargs will be passed to _generate_examples
139
- # gen_kwargs={
140
- # "filepath": os.path.join(data_dir, "dev.jsonl"),
141
- # "split": "dev",
142
- # },
143
- # ),
144
- # datasets.SplitGenerator(
145
- # name=datasets.Split.TEST,
146
- # # These kwargs will be passed to _generate_examples
147
- # gen_kwargs={
148
- # "filepath": os.path.join(data_dir, "test.jsonl"),
149
- # "split": "test"
150
- # },
151
- # ),
152
- ]
153
-
154
- # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
155
- def _generate_examples(self, filepath_eeg, filepath_metadata):
156
- # TODO: This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
157
- # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
158
- eeg_data = np.load(filepath_eeg)
159
- metadata = pd.read_pickle(filepath_metadata)
160
- for key, row in metadata.iterrows():
161
- if self.config.name == "cleaned":
162
- # Yields examples as (key, example) tuples
163
- yield key, {
164
- "event": row["event"],
165
- "word": row["word"],
166
- "topic": row["topic"],
167
- "selected_topic": row["selected_topic"],
168
- "semantic_relevance": row["semantic_relevance"],
169
- "interestingness": row["interestingness"],
170
- "pre-knowledge": row["pre-knowledge"],
171
- "sentence_number": row["sentence_number"],
172
- "participant": row["participant"],
173
- "eeg": eeg_data[key],
174
- }
175
- else:
176
- raise ValueError("Not implemented.")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md CHANGED
@@ -1,3 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
2
 
3
  We release a dataset containing 23,270 time-locked (0.7s) word-level EEG recordings acquired from 15 participants who read both text that was semantically relevant and irrelevant to self-selected topics.
 
1
+ ---
2
+ dataset_info:
3
+ config_name: cleaned
4
+ features:
5
+ - name: event
6
+ dtype: int64
7
+ - name: word
8
+ dtype: string
9
+ - name: topic
10
+ dtype: string
11
+ - name: selected_topic
12
+ dtype: string
13
+ - name: semantic_relevance
14
+ dtype: int64
15
+ - name: interestingness
16
+ dtype: int64
17
+ - name: pre-knowledge
18
+ dtype: int64
19
+ - name: sentence_number
20
+ dtype: int64
21
+ - name: participant
22
+ dtype: string
23
+ - name: eeg
24
+ dtype:
25
+ array2_d:
26
+ shape:
27
+ - 32
28
+ - 2001
29
+ dtype: float64
30
+ splits:
31
+ - name: train
32
+ num_bytes: 11925180913
33
+ num_examples: 23270
34
+ download_size: 11927979870
35
+ dataset_size: 11925180913
36
+ configs:
37
+ - config_name: cleaned
38
+ data_files:
39
+ - split: train
40
+ path: cleaned/train-*
41
+ default: true
42
+ ---
43
 
44
 
45
  We release a dataset containing 23,270 time-locked (0.7s) word-level EEG recordings acquired from 15 participants who read both text that was semantically relevant and irrelevant to self-selected topics.
data/metadataForCleanedEEG.pkl → cleaned/train-00000-of-00024.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:26d563cd715c89fc925a4932bf1cf22af34cbe657921d637db647ec39c414aff
3
- size 1818442
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:213df2d4738344c52eacc5124a6893117f6dbdc18f49b98ccfb947d39e5a9b38
3
+ size 497284247
data/cleanedEEG.npy → cleaned/train-00001-of-00024.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:9411041a08732f2f479930fbd583378bcc0a5601694cfce898a1c28348f02302
3
- size 11920197248
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f76efe05356f79c8e0bae1a630a7e2f3d7333f27f149b249ea6bbb9d59be49db
3
+ size 497284013
cleaned/train-00002-of-00024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:15092e1fecc1c189d3a25bd38444617cd303ba09bcd1007811c018d536c3e074
3
+ size 497060154
cleaned/train-00003-of-00024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7a135b6e47a58f65e0f01399a260ae94dbf1840dd9d621d29c8ff62355a81135
3
+ size 496996991
cleaned/train-00004-of-00024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2bf9eccd579aff0491ca73aa0a48f4261fd7265da68176db059be28896649318
3
+ size 497284491
cleaned/train-00005-of-00024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c00c4347617d3d24e55020d7df5c884a863430c81e382efa2d9c925168519f52
3
+ size 497284596
cleaned/train-00006-of-00024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a2663678bb16533c78750ded4670fd95674586d17c6573151b88e51ea160feae
3
+ size 497284105
cleaned/train-00007-of-00024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ecf0f304e8d7bb7f219805b3bd0f39acf4d6c3e7b0d8aa2aca6d48db3995912a
3
+ size 497285071
cleaned/train-00008-of-00024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:68616833fe04608761cbd037c613c36cdd6c3b0cfa662080824baf043e8c77b0
3
+ size 497284759
cleaned/train-00009-of-00024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b2d9a8720380e478ec48988d3126bde4a46d586b2c81f3794f514f3d39fee65e
3
+ size 496921032
cleaned/train-00010-of-00024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:865b41d2af4ad3b1035bbeaad9e93fc71317dd9a09b237812b4cc6caaa0ccc73
3
+ size 497284487
cleaned/train-00011-of-00024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b45ee1af824dd8fddc4c09eee809ea3597edf6116ff99f6a3657885eec492d0
3
+ size 497284166
cleaned/train-00012-of-00024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:64803778e84cb1f9e9d191ba8fbbb8e0c5f83921320e2d95c2be66d8d86c07ad
3
+ size 497284376
cleaned/train-00013-of-00024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d6cdad7aef9a38995cd5114df9be8621fa3ed0bf39efa5207f3e3b0177178b2c
3
+ size 497284767
cleaned/train-00014-of-00024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:354f58e62ce4ed9f9dc7ad06f7cf61116ef17625377924ac6ef406fe63a3c86b
3
+ size 496530194
cleaned/train-00015-of-00024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:498536e72711a22df325b82fcbcc46eb6dfffa8b179634791e3a0a95e09beb18
3
+ size 496772299
cleaned/train-00016-of-00024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:41a6e02613a5e849f45f03672d42f274324d9a175436a220d6e02e05a2f00442
3
+ size 496772533
cleaned/train-00017-of-00024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:408f44909b52112f06cf2d1f680a81304b4c519b8d34f165ed7998ca5d5d546f
3
+ size 496772528
cleaned/train-00018-of-00024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:85773ee1f7a35763ca2b14c3daf3919df6ec2c0b72422671f01da71a8a7102cc
3
+ size 496772412
cleaned/train-00019-of-00024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:77ab3e557844cb21cc188bfee22cc4a83cfabddfca263874d4882eb6d3084b30
3
+ size 496772135
cleaned/train-00020-of-00024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:34701c69f4ce6e851d185fedf36384637e49b4a2f72bd4d4901147a20bfb8a7d
3
+ size 496772395
cleaned/train-00021-of-00024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f554717b2acbae742e637f093b8e1fd53d9502aae36592704d0625e134f96d4a
3
+ size 496772307
cleaned/train-00022-of-00024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2d3a40916bfbcbd168861b854a61e8cc5d440d8996b069cb0ff4272295448e4
3
+ size 496163531
cleaned/train-00023-of-00024.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9c0d81462a0bb71b92af48a41b02af9e2341306a7505722300f7dca5bcbd875c
3
+ size 496772281