Datasets:
Upload fair-rationales.py
Browse files- fair-rationales.py +10 -14
fair-rationales.py
CHANGED
@@ -112,12 +112,9 @@ class FairRationales(datasets.GeneratorBasedBuilder):
|
|
112 |
label_classes=SST2_LABELS,
|
113 |
label_classes_original=["negative", "positive"],
|
114 |
attributes=[
|
115 |
-
("recruitment_ethnicity", ["
|
116 |
("recruitment_age", [">=38", "<=35"]),
|
117 |
("group_id", ["BO", "BY", "WO", "WY", "LO", "LY"]),
|
118 |
-
("gender", ["Male", "Female"]),
|
119 |
-
("english_proficiency", ["Not well", "Well", "Very well"]),
|
120 |
-
("attentioncheck", ["PASSED", "FAILED"]),
|
121 |
("sst2_id", datasets.Value("int32")),
|
122 |
("sst2_split", datasets.Value("string")),
|
123 |
],
|
@@ -158,12 +155,9 @@ class FairRationales(datasets.GeneratorBasedBuilder):
|
|
158 |
label_classes=DYNASENT_LABELS,
|
159 |
label_classes_original=["negative", "positive"],
|
160 |
attributes=[
|
161 |
-
("recruitment_ethnicity", ["
|
162 |
("recruitment_age", [">=38", "<=35"]),
|
163 |
("group_id", ["BO", "BY", "WO", "WY", "LO", "LY"]),
|
164 |
-
("gender", ["Male", "Female", "Why do you conflate sex and gender?"]),
|
165 |
-
("english_proficiency", ["Not well", "Well", "Very well"]),
|
166 |
-
("attentioncheck", ["PASSED", "FAILED"]),
|
167 |
],
|
168 |
data_url=os.path.join(MAIN_PATH, "dynasent.zip"),
|
169 |
url="https://huggingface.co/datasets/dynabench/dynasent",
|
@@ -192,12 +186,9 @@ class FairRationales(datasets.GeneratorBasedBuilder):
|
|
192 |
),
|
193 |
label_classes_original=["A", "B", "C", "D", "E"],
|
194 |
attributes=[
|
195 |
-
("recruitment_ethnicity", ["
|
196 |
("recruitment_age", [">=38", "<=35"]),
|
197 |
("group_id", ["BO", "BY", "WO", "WY", "LO", "LY"]),
|
198 |
-
("gender", ["Male", "Female", "Curious ", "Non-binary/third gender"]),
|
199 |
-
("english_proficiency", ["Not well", "Well", "Very well"]),
|
200 |
-
("attentioncheck", ["PASSED", "FAILED"]),
|
201 |
],
|
202 |
data_url=os.path.join(MAIN_PATH, "cose.zip"),
|
203 |
url="https://huggingface.co/datasets/cos_e",
|
@@ -230,7 +221,10 @@ class FairRationales(datasets.GeneratorBasedBuilder):
|
|
230 |
"age": datasets.Value("int32"),
|
231 |
"ethnicity": datasets.Value("string"),
|
232 |
"originaldata_id": datasets.Value("string"),
|
233 |
-
"annotator_ID": datasets.Value("int64")
|
|
|
|
|
|
|
234 |
}
|
235 |
if self.config.name == "cose":
|
236 |
features["label"] = datasets.Value("string")
|
@@ -280,7 +274,9 @@ class FairRationales(datasets.GeneratorBasedBuilder):
|
|
280 |
"ethnicity": data["ethnicity"],
|
281 |
"gender": data["gender"],
|
282 |
"originaldata_id": data["originaldata_id"],
|
283 |
-
"annotator_ID": data["annotator_ID"]
|
|
|
|
|
284 |
}
|
285 |
for attribute_name, _ in self.config.attributes:
|
286 |
example[attribute_name] = data[attribute_name]
|
|
|
112 |
label_classes=SST2_LABELS,
|
113 |
label_classes_original=["negative", "positive"],
|
114 |
attributes=[
|
115 |
+
("recruitment_ethnicity", ["Black/African American", "White/Causasian", "Latino/Hispanic"]),
|
116 |
("recruitment_age", [">=38", "<=35"]),
|
117 |
("group_id", ["BO", "BY", "WO", "WY", "LO", "LY"]),
|
|
|
|
|
|
|
118 |
("sst2_id", datasets.Value("int32")),
|
119 |
("sst2_split", datasets.Value("string")),
|
120 |
],
|
|
|
155 |
label_classes=DYNASENT_LABELS,
|
156 |
label_classes_original=["negative", "positive"],
|
157 |
attributes=[
|
158 |
+
("recruitment_ethnicity", ["Black/African American", "White/Causasian", "Latino/Hispanic"]),
|
159 |
("recruitment_age", [">=38", "<=35"]),
|
160 |
("group_id", ["BO", "BY", "WO", "WY", "LO", "LY"]),
|
|
|
|
|
|
|
161 |
],
|
162 |
data_url=os.path.join(MAIN_PATH, "dynasent.zip"),
|
163 |
url="https://huggingface.co/datasets/dynabench/dynasent",
|
|
|
186 |
),
|
187 |
label_classes_original=["A", "B", "C", "D", "E"],
|
188 |
attributes=[
|
189 |
+
("recruitment_ethnicity", ["Black/African American", "White/Causasian", "Latino/Hispanic"]),
|
190 |
("recruitment_age", [">=38", "<=35"]),
|
191 |
("group_id", ["BO", "BY", "WO", "WY", "LO", "LY"]),
|
|
|
|
|
|
|
192 |
],
|
193 |
data_url=os.path.join(MAIN_PATH, "cose.zip"),
|
194 |
url="https://huggingface.co/datasets/cos_e",
|
|
|
221 |
"age": datasets.Value("int32"),
|
222 |
"ethnicity": datasets.Value("string"),
|
223 |
"originaldata_id": datasets.Value("string"),
|
224 |
+
"annotator_ID": datasets.Value("int64"),
|
225 |
+
"english_proficiency": datasets.Value("string"),
|
226 |
+
"attentioncheck": datasets.Value("string"),
|
227 |
+
"gender": datasets.Value("string")
|
228 |
}
|
229 |
if self.config.name == "cose":
|
230 |
features["label"] = datasets.Value("string")
|
|
|
274 |
"ethnicity": data["ethnicity"],
|
275 |
"gender": data["gender"],
|
276 |
"originaldata_id": data["originaldata_id"],
|
277 |
+
"annotator_ID": data["annotator_ID"],
|
278 |
+
"english_proficiency": data["english_proficiency"],
|
279 |
+
"attentioncheck": data["attentioncheck"]
|
280 |
}
|
281 |
for attribute_name, _ in self.config.attributes:
|
282 |
example[attribute_name] = data[attribute_name]
|