Datasets:
Tasks:
Text Classification
Sub-tasks:
acceptability-classification
Languages:
English
Size:
10K<n<100K
Tags:
cola
License:
Update blimp_classification.py
Browse files- blimp_classification.py +8 -9
blimp_classification.py
CHANGED
|
@@ -67,7 +67,6 @@ class BlimpConfig(datasets.BuilderConfig):
|
|
| 67 |
self,
|
| 68 |
text_features,
|
| 69 |
label_classes=None,
|
| 70 |
-
process_label=lambda x: x,
|
| 71 |
**kwargs,
|
| 72 |
):
|
| 73 |
"""BuilderConfig for Blimp.
|
|
@@ -99,7 +98,6 @@ class BlimpConfig(datasets.BuilderConfig):
|
|
| 99 |
self.data_url = DATA_URL
|
| 100 |
self.data_dir = os.path.join("blimp", self.name)
|
| 101 |
self.citation = textwrap.dedent(_Blimp_CITATION)
|
| 102 |
-
self.process_label = process_label
|
| 103 |
self.description = ""
|
| 104 |
self.url = ""
|
| 105 |
|
|
@@ -113,23 +111,23 @@ class Blimp(datasets.GeneratorBasedBuilder):
|
|
| 113 |
BUILDER_CONFIGS = [
|
| 114 |
BlimpConfig(
|
| 115 |
name="syntax_semantics",
|
| 116 |
-
text_features={"
|
| 117 |
),
|
| 118 |
BlimpConfig(
|
| 119 |
-
name=
|
| 120 |
-
text_features={"
|
| 121 |
),
|
| 122 |
BlimpConfig(
|
| 123 |
name="morphology",
|
| 124 |
-
text_features={"
|
| 125 |
),
|
| 126 |
BlimpConfig(
|
| 127 |
name="syntax",
|
| 128 |
-
text_features={"
|
| 129 |
),
|
| 130 |
BlimpConfig(
|
| 131 |
name="semantics",
|
| 132 |
-
text_features={"
|
| 133 |
),
|
| 134 |
]
|
| 135 |
|
|
@@ -168,7 +166,6 @@ class Blimp(datasets.GeneratorBasedBuilder):
|
|
| 168 |
|
| 169 |
def _generate_examples(self, data_file, split):
|
| 170 |
|
| 171 |
-
process_label = self.config.process_label
|
| 172 |
label_classes = self.config.label_classes
|
| 173 |
|
| 174 |
with open(data_file) as f:
|
|
@@ -190,4 +187,6 @@ class Blimp(datasets.GeneratorBasedBuilder):
|
|
| 190 |
example["label"] = process_label(label)
|
| 191 |
else:
|
| 192 |
example["label"] = process_label(-1)
|
|
|
|
|
|
|
| 193 |
yield example["idx"], example
|
|
|
|
| 67 |
self,
|
| 68 |
text_features,
|
| 69 |
label_classes=None,
|
|
|
|
| 70 |
**kwargs,
|
| 71 |
):
|
| 72 |
"""BuilderConfig for Blimp.
|
|
|
|
| 98 |
self.data_url = DATA_URL
|
| 99 |
self.data_dir = os.path.join("blimp", self.name)
|
| 100 |
self.citation = textwrap.dedent(_Blimp_CITATION)
|
|
|
|
| 101 |
self.description = ""
|
| 102 |
self.url = ""
|
| 103 |
|
|
|
|
| 111 |
BUILDER_CONFIGS = [
|
| 112 |
BlimpConfig(
|
| 113 |
name="syntax_semantics",
|
| 114 |
+
text_features={"sentence": "sentence"},
|
| 115 |
),
|
| 116 |
BlimpConfig(
|
| 117 |
+
name="syntax+semantics",
|
| 118 |
+
text_features={"sentence": "sentence"},
|
| 119 |
),
|
| 120 |
BlimpConfig(
|
| 121 |
name="morphology",
|
| 122 |
+
text_features={"sentence": "text"},
|
| 123 |
),
|
| 124 |
BlimpConfig(
|
| 125 |
name="syntax",
|
| 126 |
+
text_features={"sentence": "sentence"},
|
| 127 |
),
|
| 128 |
BlimpConfig(
|
| 129 |
name="semantics",
|
| 130 |
+
text_features={"sentence": "sentence"},
|
| 131 |
),
|
| 132 |
]
|
| 133 |
|
|
|
|
| 166 |
|
| 167 |
def _generate_examples(self, data_file, split):
|
| 168 |
|
|
|
|
| 169 |
label_classes = self.config.label_classes
|
| 170 |
|
| 171 |
with open(data_file) as f:
|
|
|
|
| 187 |
example["label"] = process_label(label)
|
| 188 |
else:
|
| 189 |
example["label"] = process_label(-1)
|
| 190 |
+
example['sentence'] = example['text']
|
| 191 |
+
del example['text']
|
| 192 |
yield example["idx"], example
|