parquet-converter commited on
Commit
a398d59
·
1 Parent(s): 939a75e

Update parquet files

Browse files
.gitattributes DELETED
@@ -1,39 +0,0 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bin.* filter=lfs diff=lfs merge=lfs -text
5
- *.bz2 filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.model filter=lfs diff=lfs merge=lfs -text
12
- *.msgpack filter=lfs diff=lfs merge=lfs -text
13
- *.onnx filter=lfs diff=lfs merge=lfs -text
14
- *.ot filter=lfs diff=lfs merge=lfs -text
15
- *.parquet filter=lfs diff=lfs merge=lfs -text
16
- *.pb filter=lfs diff=lfs merge=lfs -text
17
- *.pt filter=lfs diff=lfs merge=lfs -text
18
- *.pth filter=lfs diff=lfs merge=lfs -text
19
- *.rar filter=lfs diff=lfs merge=lfs -text
20
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
21
- *.tar.* filter=lfs diff=lfs merge=lfs -text
22
- *.tflite filter=lfs diff=lfs merge=lfs -text
23
- *.tgz filter=lfs diff=lfs merge=lfs -text
24
- *.wasm filter=lfs diff=lfs merge=lfs -text
25
- *.xz filter=lfs diff=lfs merge=lfs -text
26
- *.zip filter=lfs diff=lfs merge=lfs -text
27
- *.zstandard filter=lfs diff=lfs merge=lfs -text
28
- *tfevents* filter=lfs diff=lfs merge=lfs -text
29
- # Audio files - uncompressed
30
- *.pcm filter=lfs diff=lfs merge=lfs -text
31
- *.sam filter=lfs diff=lfs merge=lfs -text
32
- *.raw filter=lfs diff=lfs merge=lfs -text
33
- # Audio files - compressed
34
- *.aac filter=lfs diff=lfs merge=lfs -text
35
- *.flac filter=lfs diff=lfs merge=lfs -text
36
- *.mp3 filter=lfs diff=lfs merge=lfs -text
37
- *.ogg filter=lfs diff=lfs merge=lfs -text
38
- *.wav filter=lfs diff=lfs merge=lfs -text
39
- *.csv filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ROLE/test.csv → CPRAG/psycholinguistic_eval-test.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:6c23629624cb61044210439586f9fe4514f3baef2fa256f580e44cb981de0649
3
- size 8668
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:73b784cea6b1811c03cd42e3bdac61738de225a85712972db3ed72c2f01e9b1c
3
+ size 7556
CPRAG/test.csv → NEG-NAT/psycholinguistic_eval-test.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:17e185c8abcc3b6ea0f28485e43334608cd50105c51f18e93ffa2d5d935b37a9
3
- size 4875
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b8595f383f358652bf6dcc403f393597573334128b2dabbd117c4dd1d47dab6
3
+ size 3743
NEG-NAT/test.csv → NEG-SIMP/psycholinguistic_eval-test.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5f3efad556ade6d624d612314e60b522d34ffd901a5911cdeb1f1563b6bb4e06
3
- size 1450
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:793e78e297c4065835e3f8f47cde8ff7aee16911170b7fc37109827065664566
3
+ size 2853
README.md DELETED
@@ -1,24 +0,0 @@
1
- ---
2
- annotations_creators:
3
- - expert-generated
4
- language_creators:
5
- - expert-generated
6
- language:
7
- - en-US
8
- license:
9
- - mit
10
- multilinguality:
11
- - monolingual
12
- pretty_name: psycholinguistic_eval
13
- size_categories:
14
- - n<1K
15
- source_datasets: []
16
- task_categories:
17
- - multiple-choice
18
- - fill-mask
19
- - question-answering
20
- - zero-shot-classification
21
- task_ids: []
22
- ---
23
-
24
- This is a suite of psycholinguistic datasets by Allyson Ettinger. See her [official Github repository](https://github.com/aetting/lm-diagnostics) for specific details.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
NEG-SIMP/test.csv → ROLE/psycholinguistic_eval-test.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:b756a3d8c2bd4e919986e38b3e64f85b10aabc06c967b59eb098821a584dfc28
3
- size 996
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7ea1f30cc7f33474ac53b387ecf3a51e194f603d939bae1f35a6cd5a03e0d901
3
+ size 4435
dataset_infos.json DELETED
@@ -1 +0,0 @@
1
- {"CPRAG": {"description": "Psycholinguistic dataset from 'What BERT is not: Lessons from a new suite of psycholinguistic diagnostics for language models'\nby Allyson Ettinger\n", "citation": "@article{ettinger2020bert,\n title={What BERT is not: Lessons from a new suite of psycholinguistic diagnostics for language models},\n author={Ettinger, Allyson},\n journal={Transactions of the Association for Computational Linguistics},\n volume={8},\n pages={34--48},\n year={2020},\n publisher={MIT Press}\n}\n", "homepage": "https://github.com/aetting/lm-diagnostics", "license": "MIT License\n\nCopyright (c) 2020 Allyson Ettinger\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", "features": {"context_s1": {"dtype": "string", "id": null, "_type": "Value"}, "context_s2": {"dtype": "string", "id": null, "_type": "Value"}, "expected": {"dtype": "string", "id": null, "_type": "Value"}, "within_category": {"dtype": "string", "id": null, "_type": "Value"}, "between_category": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "psycholinguistic_eval_dataset", "config_name": "CPRAG", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 5202, "num_examples": 34, "dataset_name": "psycholinguistic_eval_dataset"}}, "download_checksums": {"https://huggingface.co/datasets/KevinZ/psycholinguistic_eval/resolve/main/CPRAG/test.csv": {"num_bytes": 4875, "checksum": "17e185c8abcc3b6ea0f28485e43334608cd50105c51f18e93ffa2d5d935b37a9"}, "https://huggingface.co/datasets/KevinZ/psycholinguistic_eval/resolve/main/ROLE/test.csv": {"num_bytes": 8668, "checksum": "6c23629624cb61044210439586f9fe4514f3baef2fa256f580e44cb981de0649"}, "https://huggingface.co/datasets/KevinZ/psycholinguistic_eval/resolve/main/NEG-NAT/test.csv": {"num_bytes": 1450, "checksum": "5f3efad556ade6d624d612314e60b522d34ffd901a5911cdeb1f1563b6bb4e06"}, "https://huggingface.co/datasets/KevinZ/psycholinguistic_eval/resolve/main/NEG-SIMP/test.csv": {"num_bytes": 996, "checksum": "b756a3d8c2bd4e919986e38b3e64f85b10aabc06c967b59eb098821a584dfc28"}}, "download_size": 15989, "post_processing_size": null, "dataset_size": 5202, "size_in_bytes": 21191}, "ROLE": {"description": "Psycholinguistic dataset from 'What BERT is not: Lessons from a new suite of psycholinguistic diagnostics for language models'\nby Allyson Ettinger\n", "citation": "@article{ettinger2020bert,\n title={What BERT is not: Lessons from a new suite of psycholinguistic diagnostics for language models},\n author={Ettinger, Allyson},\n journal={Transactions of the Association for Computational Linguistics},\n volume={8},\n pages={34--48},\n year={2020},\n publisher={MIT Press}\n}\n", "homepage": "https://github.com/aetting/lm-diagnostics", "license": "MIT License\n\nCopyright (c) 2020 Allyson Ettinger\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", "features": {"context": {"dtype": "string", "id": null, "_type": "Value"}, "expected": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "psycholinguistic_eval_dataset", "config_name": "ROLE", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 6290, "num_examples": 88, "dataset_name": "psycholinguistic_eval_dataset"}}, "download_checksums": {"https://huggingface.co/datasets/KevinZ/psycholinguistic_eval/resolve/main/CPRAG/test.csv": {"num_bytes": 4875, "checksum": "17e185c8abcc3b6ea0f28485e43334608cd50105c51f18e93ffa2d5d935b37a9"}, "https://huggingface.co/datasets/KevinZ/psycholinguistic_eval/resolve/main/ROLE/test.csv": {"num_bytes": 8668, "checksum": "6c23629624cb61044210439586f9fe4514f3baef2fa256f580e44cb981de0649"}, "https://huggingface.co/datasets/KevinZ/psycholinguistic_eval/resolve/main/NEG-NAT/test.csv": {"num_bytes": 1450, "checksum": "5f3efad556ade6d624d612314e60b522d34ffd901a5911cdeb1f1563b6bb4e06"}, "https://huggingface.co/datasets/KevinZ/psycholinguistic_eval/resolve/main/NEG-SIMP/test.csv": {"num_bytes": 996, "checksum": "b756a3d8c2bd4e919986e38b3e64f85b10aabc06c967b59eb098821a584dfc28"}}, "download_size": 15989, "post_processing_size": null, "dataset_size": 6290, "size_in_bytes": 22279}, "NEG-NAT": {"description": "Psycholinguistic dataset from 'What BERT is not: Lessons from a new suite of psycholinguistic diagnostics for language models'\nby Allyson Ettinger\n", "citation": "@article{ettinger2020bert,\n title={What BERT is not: Lessons from a new suite of psycholinguistic diagnostics for language models},\n author={Ettinger, Allyson},\n journal={Transactions of the Association for Computational Linguistics},\n volume={8},\n pages={34--48},\n year={2020},\n publisher={MIT Press}\n}\n", "homepage": "https://github.com/aetting/lm-diagnostics", "license": "MIT License\n\nCopyright (c) 2020 Allyson Ettinger\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", "features": {"context_aff": {"dtype": "string", "id": null, "_type": "Value"}, "context_neg": {"dtype": "string", "id": null, "_type": "Value"}, "target_aff": {"dtype": "string", "id": null, "_type": "Value"}, "target_neg": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "psycholinguistic_eval_dataset", "config_name": "NEG-NAT", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 1546, "num_examples": 16, "dataset_name": "psycholinguistic_eval_dataset"}}, "download_checksums": {"https://huggingface.co/datasets/KevinZ/psycholinguistic_eval/resolve/main/CPRAG/test.csv": {"num_bytes": 4875, "checksum": "17e185c8abcc3b6ea0f28485e43334608cd50105c51f18e93ffa2d5d935b37a9"}, "https://huggingface.co/datasets/KevinZ/psycholinguistic_eval/resolve/main/ROLE/test.csv": {"num_bytes": 8668, "checksum": "6c23629624cb61044210439586f9fe4514f3baef2fa256f580e44cb981de0649"}, "https://huggingface.co/datasets/KevinZ/psycholinguistic_eval/resolve/main/NEG-NAT/test.csv": {"num_bytes": 1450, "checksum": "5f3efad556ade6d624d612314e60b522d34ffd901a5911cdeb1f1563b6bb4e06"}, "https://huggingface.co/datasets/KevinZ/psycholinguistic_eval/resolve/main/NEG-SIMP/test.csv": {"num_bytes": 996, "checksum": "b756a3d8c2bd4e919986e38b3e64f85b10aabc06c967b59eb098821a584dfc28"}}, "download_size": 15989, "post_processing_size": null, "dataset_size": 1546, "size_in_bytes": 17535}, "NEG-SIMP": {"description": "Psycholinguistic dataset from 'What BERT is not: Lessons from a new suite of psycholinguistic diagnostics for language models'\nby Allyson Ettinger\n", "citation": "@article{ettinger2020bert,\n title={What BERT is not: Lessons from a new suite of psycholinguistic diagnostics for language models},\n author={Ettinger, Allyson},\n journal={Transactions of the Association for Computational Linguistics},\n volume={8},\n pages={34--48},\n year={2020},\n publisher={MIT Press}\n}\n", "homepage": "https://github.com/aetting/lm-diagnostics", "license": "MIT License\n\nCopyright (c) 2020 Allyson Ettinger\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", "features": {"context_aff": {"dtype": "string", "id": null, "_type": "Value"}, "context_neg": {"dtype": "string", "id": null, "_type": "Value"}, "target_aff": {"dtype": "string", "id": null, "_type": "Value"}, "target_neg": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": null, "task_templates": null, "builder_name": "psycholinguistic_eval_dataset", "config_name": "NEG-SIMP", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 1166, "num_examples": 18, "dataset_name": "psycholinguistic_eval_dataset"}}, "download_checksums": {"https://huggingface.co/datasets/KevinZ/psycholinguistic_eval/resolve/main/CPRAG/test.csv": {"num_bytes": 4875, "checksum": "17e185c8abcc3b6ea0f28485e43334608cd50105c51f18e93ffa2d5d935b37a9"}, "https://huggingface.co/datasets/KevinZ/psycholinguistic_eval/resolve/main/ROLE/test.csv": {"num_bytes": 8668, "checksum": "6c23629624cb61044210439586f9fe4514f3baef2fa256f580e44cb981de0649"}, "https://huggingface.co/datasets/KevinZ/psycholinguistic_eval/resolve/main/NEG-NAT/test.csv": {"num_bytes": 1450, "checksum": "5f3efad556ade6d624d612314e60b522d34ffd901a5911cdeb1f1563b6bb4e06"}, "https://huggingface.co/datasets/KevinZ/psycholinguistic_eval/resolve/main/NEG-SIMP/test.csv": {"num_bytes": 996, "checksum": "b756a3d8c2bd4e919986e38b3e64f85b10aabc06c967b59eb098821a584dfc28"}}, "download_size": 15989, "post_processing_size": null, "dataset_size": 1166, "size_in_bytes": 17155}}
 
 
psycholinguistic_eval.py DELETED
@@ -1,211 +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
-
18
- import datasets
19
- import pandas as pd
20
-
21
-
22
- # Find for instance the citation on arxiv or on the dataset repo/website
23
- _CITATION = """\
24
- @article{ettinger2020bert,
25
- title={What BERT is not: Lessons from a new suite of psycholinguistic diagnostics for language models},
26
- author={Ettinger, Allyson},
27
- journal={Transactions of the Association for Computational Linguistics},
28
- volume={8},
29
- pages={34--48},
30
- year={2020},
31
- publisher={MIT Press}
32
- }
33
- """
34
-
35
- # You can copy an official description
36
- _DESCRIPTION = """\
37
- Psycholinguistic dataset from 'What BERT is not: Lessons from a new suite of psycholinguistic diagnostics for language models'
38
- by Allyson Ettinger
39
- """
40
-
41
- _HOMEPAGE = "https://github.com/aetting/lm-diagnostics"
42
-
43
- _LICENSE = """MIT License
44
-
45
- Copyright (c) 2020 Allyson Ettinger
46
-
47
- Permission is hereby granted, free of charge, to any person obtaining a copy
48
- of this software and associated documentation files (the "Software"), to deal
49
- in the Software without restriction, including without limitation the rights
50
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
51
- copies of the Software, and to permit persons to whom the Software is
52
- furnished to do so, subject to the following conditions:
53
-
54
- The above copyright notice and this permission notice shall be included in all
55
- copies or substantial portions of the Software.
56
-
57
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
58
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
59
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
60
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
61
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
62
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
63
- SOFTWARE.
64
- """
65
-
66
- # The HuggingFace Datasets library doesn't host the datasets but only points to the original files.
67
- # This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
68
- _URL = "https://huggingface.co/datasets/KevinZ/psycholinguistic_eval/resolve/main/"
69
- _URLS = {
70
- "CPRAG": _URL + "CPRAG/test.csv",
71
- "ROLE": _URL + "ROLE/test.csv",
72
- "NEG-NAT": _URL + "NEG-NAT/test.csv",
73
- "NEG-SIMP": _URL + "NEG-SIMP/test.csv",
74
- }
75
-
76
- # TODO: Name of the dataset usually match the script name with CamelCase instead of snake_case
77
- class PsycholinguisticEvalDataset(datasets.GeneratorBasedBuilder):
78
- """TODO: Short description of my dataset."""
79
-
80
- VERSION = datasets.Version("1.0.0")
81
-
82
- # This is an example of a dataset with multiple configurations.
83
- # If you don't want/need to define several sub-sets in your dataset,
84
- # just remove the BUILDER_CONFIG_CLASS and the BUILDER_CONFIGS attributes.
85
-
86
- # If you need to make complex sub-parts in the datasets with configurable options
87
- # You can create your own builder configuration class to store attribute, inheriting from datasets.BuilderConfig
88
- # BUILDER_CONFIG_CLASS = MyBuilderConfig
89
-
90
- # You will be able to load one or the other configurations in the following list with
91
- # data = datasets.load_dataset('my_dataset', 'first_domain')
92
- # data = datasets.load_dataset('my_dataset', 'second_domain')
93
- BUILDER_CONFIGS = [
94
- datasets.BuilderConfig(name="CPRAG", version=VERSION, description="34 questions evaluating commonsense knowledge"),
95
- datasets.BuilderConfig(name="ROLE", version=VERSION, description="88 questions evaluating event knowledge and semantic roles"),
96
- datasets.BuilderConfig(name="NEG-NAT", version=VERSION, description="[NEG-NAT description]"),
97
- datasets.BuilderConfig(name="NEG-SIMP", version=VERSION, description="[NEG-SIMP description]"),
98
- ]
99
-
100
- def _info(self):
101
- # TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
102
- if self.config.name == "CPRAG": # This is the name of the configuration selected in BUILDER_CONFIGS above
103
- features = datasets.Features(
104
- {
105
- "context_s1": datasets.Value("string"),
106
- "context_s2": datasets.Value("string"),
107
- "expected": datasets.Value("string"),
108
- "within_category": datasets.Value("string"),
109
- "between_category": datasets.Value("string"),
110
- }
111
- )
112
- elif self.config.name == "ROLE":
113
- features = datasets.Features(
114
- {
115
- "context": datasets.Value("string"),
116
- "expected": datasets.Value("string"),
117
- }
118
- )
119
- elif self.config.name == "NEG-NAT":
120
- features = datasets.Features(
121
- {
122
- "context_aff": datasets.Value("string"),
123
- "context_neg": datasets.Value("string"),
124
- "target_aff": datasets.Value("string"),
125
- "target_neg": datasets.Value("string"),
126
- }
127
- )
128
- elif self.config.name == "NEG-SIMP":
129
- features = datasets.Features(
130
- {
131
- "context_aff": datasets.Value("string"),
132
- "context_neg": datasets.Value("string"),
133
- "target_aff": datasets.Value("string"),
134
- "target_neg": datasets.Value("string"),
135
- }
136
- )
137
- else:
138
- raise NotImplementedError
139
-
140
- return datasets.DatasetInfo(
141
- # This is the description that will appear on the datasets page.
142
- description=_DESCRIPTION,
143
- # This defines the different columns of the dataset and their types
144
- features=features, # Here we define them above because they are different between the two configurations
145
- # If there's a common (input, target) tuple from the features, uncomment supervised_keys line below and
146
- # specify them. They'll be used if as_supervised=True in builder.as_dataset.
147
- # supervised_keys=("sentence", "label"),
148
- # Homepage of the dataset for documentation
149
- homepage=_HOMEPAGE,
150
- # License for the dataset if available
151
- license=_LICENSE,
152
- # Citation for the dataset
153
- citation=_CITATION,
154
- )
155
-
156
- def _split_generators(self, dl_manager):
157
- # TODO: This method is tasked with downloading/extracting the data and defining the splits depending on the configuration
158
- # If several configurations are possible (listed in BUILDER_CONFIGS), the configuration selected by the user is in self.config.name
159
-
160
- # dl_manager is a datasets.download.DownloadManager that can be used to download and extract URLS
161
- # 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.
162
- # By default the archives will be extracted and a path to a cached folder where they are extracted is returned instead of the archive
163
-
164
- downloaded_files = dl_manager.download_and_extract(_URLS)
165
-
166
- return [
167
- datasets.SplitGenerator(
168
- name=datasets.Split.TEST,
169
- # These kwargs will be passed to _generate_examples
170
- gen_kwargs={
171
- "filepath": downloaded_files[self.config.name],
172
- "split": "test"
173
- },
174
- ),
175
- ]
176
-
177
- # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
178
- def _generate_examples(self, filepath, split):
179
- # The `key` is for legacy reasons (tfds) and is not important in itself, but must be unique for each example.
180
- df = pd.read_csv(filepath)
181
- for index, row in df.iterrows():
182
- if self.config.name == "CPRAG":
183
- # Yields examples as (key, example) tuples
184
- yield index, {
185
- "context_s1": row["context_s1"],
186
- "context_s2": row["context_s2"],
187
- "expected": row["expected"],
188
- "within_category": row["within_category"],
189
- "between_category": row["between_category"],
190
- }
191
- elif self.config.name == "ROLE":
192
- yield index, {
193
- "context": row["context"],
194
- "expected": row["expected"],
195
- }
196
- elif self.config.name == "NEG-NAT":
197
- yield index, {
198
- "context_aff": row["context_aff"],
199
- "context_neg": row["context_neg"],
200
- "target_aff": row["target_aff"],
201
- "target_neg": row["target_neg"],
202
- }
203
- elif self.config.name == "NEG-SIMP":
204
- yield index, {
205
- "context_aff": row["context_aff"],
206
- "context_neg": row["context_neg"],
207
- "target_aff": row["target_aff"],
208
- "target_neg": row["target_neg"],
209
- }
210
- else:
211
- raise NotImplementedError