Datasets:
Sub-tasks:
hate-speech-detection
Languages:
English
Size:
100K<n<1M
Tags:
explanation-generation
License:
Commit
•
a9f99ad
0
Parent(s):
Update files from the datasets library (from 1.0.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.0.0
- .gitattributes +27 -0
- dataset_infos.json +1 -0
- dummy/0.0.0/dummy_data.zip +3 -0
- social_bias_frames.py +99 -0
.gitattributes
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"default": {"description": "Social Bias Frames is a new way of representing the biases and offensiveness that are implied in language. \nFor example, these frames are meant to distill the implication that \"women (candidates) are less qualified\" \nbehind the statement \"we shouldn\u2019t lower our standards to hire more women.\"\n", "citation": "@inproceedings{sap2020socialbiasframes,\n title={Social Bias Frames: Reasoning about Social and Power Implications of Language},\n author={Sap, Maarten and Gabriel, Saadia and Qin, Lianhui and Jurafsky, Dan and Smith, Noah A and Choi, Yejin},\n year={2020},\n booktitle={ACL},\n}\n", "homepage": "https://homes.cs.washington.edu/~msap/social-bias-frames/", "license": "", "features": {"whoTarget": {"dtype": "string", "id": null, "_type": "Value"}, "intentYN": {"dtype": "string", "id": null, "_type": "Value"}, "sexYN": {"dtype": "string", "id": null, "_type": "Value"}, "sexReason": {"dtype": "string", "id": null, "_type": "Value"}, "offensiveYN": {"dtype": "string", "id": null, "_type": "Value"}, "annotatorGender": {"dtype": "string", "id": null, "_type": "Value"}, "annotatorMinority": {"dtype": "string", "id": null, "_type": "Value"}, "sexPhrase": {"dtype": "string", "id": null, "_type": "Value"}, "speakerMinorityYN": {"dtype": "string", "id": null, "_type": "Value"}, "WorkerId": {"dtype": "string", "id": null, "_type": "Value"}, "HITId": {"dtype": "string", "id": null, "_type": "Value"}, "annotatorPolitics": {"dtype": "string", "id": null, "_type": "Value"}, "annotatorRace": {"dtype": "string", "id": null, "_type": "Value"}, "annotatorAge": {"dtype": "string", "id": null, "_type": "Value"}, "post": {"dtype": "string", "id": null, "_type": "Value"}, "targetMinority": {"dtype": "string", "id": null, "_type": "Value"}, "targetCategory": {"dtype": "string", "id": null, "_type": "Value"}, "targetStereotype": {"dtype": "string", "id": null, "_type": "Value"}}, "supervised_keys": null, "builder_name": "social_bias_frames", "config_name": "default", "version": {"version_str": "0.0.0", "description": null, "datasets_version_to_prepare": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"test": {"name": "test", "num_bytes": 5169855, "num_examples": 17501, "dataset_name": "social_bias_frames"}, "validation": {"name": "validation", "num_bytes": 4904733, "num_examples": 16738, "dataset_name": "social_bias_frames"}, "train": {"name": "train", "num_bytes": 32739659, "num_examples": 112900, "dataset_name": "social_bias_frames"}}, "download_checksums": {"https://homes.cs.washington.edu/~msap/social-bias-frames/SocialBiasFrames_v2.tgz": {"num_bytes": 6250039, "checksum": "9d572fc25530789602c58b433ac8a4d3c8e4962e3ba09cab5d135e851b8cec78"}}, "download_size": 6250039, "dataset_size": 42814247, "size_in_bytes": 49064286}}
|
dummy/0.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d9e85caa0f8d436bc287363b98c65197f109cb680b2f514d68ac6ec8288ee28d
|
3 |
+
size 1953
|
social_bias_frames.py
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace Datasets Authors.
|
3 |
+
#
|
4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
+
# you may not use this file except in compliance with the License.
|
6 |
+
# You may obtain a copy of the License at
|
7 |
+
#
|
8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
+
#
|
10 |
+
# Unless required by applicable law or agreed to in writing, software
|
11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
# See the License for the specific language governing permissions and
|
14 |
+
# limitations under the License.
|
15 |
+
|
16 |
+
# Lint as: python3
|
17 |
+
"""Social Bias Frames"""
|
18 |
+
|
19 |
+
from __future__ import absolute_import, division, print_function
|
20 |
+
|
21 |
+
import csv
|
22 |
+
import os
|
23 |
+
|
24 |
+
import datasets
|
25 |
+
|
26 |
+
|
27 |
+
_CITATION = """\
|
28 |
+
@inproceedings{sap2020socialbiasframes,
|
29 |
+
title={Social Bias Frames: Reasoning about Social and Power Implications of Language},
|
30 |
+
author={Sap, Maarten and Gabriel, Saadia and Qin, Lianhui and Jurafsky, Dan and Smith, Noah A and Choi, Yejin},
|
31 |
+
year={2020},
|
32 |
+
booktitle={ACL},
|
33 |
+
}
|
34 |
+
"""
|
35 |
+
|
36 |
+
_DESCRIPTION = """\
|
37 |
+
Social Bias Frames is a new way of representing the biases and offensiveness that are implied in language.
|
38 |
+
For example, these frames are meant to distill the implication that "women (candidates) are less qualified"
|
39 |
+
behind the statement "we shouldn’t lower our standards to hire more women."
|
40 |
+
"""
|
41 |
+
|
42 |
+
_DATA_URL = "https://homes.cs.washington.edu/~msap/social-bias-frames/SocialBiasFrames_v2.tgz"
|
43 |
+
|
44 |
+
|
45 |
+
class SocialBiasFrames(datasets.GeneratorBasedBuilder):
|
46 |
+
"""TSocial Bias Frame"""
|
47 |
+
|
48 |
+
def _info(self):
|
49 |
+
return datasets.DatasetInfo(
|
50 |
+
description=_DESCRIPTION,
|
51 |
+
features=datasets.Features(
|
52 |
+
{
|
53 |
+
"whoTarget": datasets.Value("string"),
|
54 |
+
"intentYN": datasets.Value("string"),
|
55 |
+
"sexYN": datasets.Value("string"),
|
56 |
+
"sexReason": datasets.Value("string"),
|
57 |
+
"offensiveYN": datasets.Value("string"),
|
58 |
+
"annotatorGender": datasets.Value("string"),
|
59 |
+
"annotatorMinority": datasets.Value("string"),
|
60 |
+
"sexPhrase": datasets.Value("string"),
|
61 |
+
"speakerMinorityYN": datasets.Value("string"),
|
62 |
+
"WorkerId": datasets.Value("string"),
|
63 |
+
"HITId": datasets.Value("string"),
|
64 |
+
"annotatorPolitics": datasets.Value("string"),
|
65 |
+
"annotatorRace": datasets.Value("string"),
|
66 |
+
"annotatorAge": datasets.Value("string"),
|
67 |
+
"post": datasets.Value("string"),
|
68 |
+
"targetMinority": datasets.Value("string"),
|
69 |
+
"targetCategory": datasets.Value("string"),
|
70 |
+
"targetStereotype": datasets.Value("string"),
|
71 |
+
}
|
72 |
+
),
|
73 |
+
# No default supervised_keys (as we have to pass both premise
|
74 |
+
# and hypothesis as input).
|
75 |
+
supervised_keys=None,
|
76 |
+
homepage="https://homes.cs.washington.edu/~msap/social-bias-frames/",
|
77 |
+
citation=_CITATION,
|
78 |
+
)
|
79 |
+
|
80 |
+
def _split_generators(self, dl_manager):
|
81 |
+
dl_dir = dl_manager.download_and_extract(_DATA_URL)
|
82 |
+
return [
|
83 |
+
datasets.SplitGenerator(
|
84 |
+
name=datasets.Split.TEST, gen_kwargs={"filepath": os.path.join(dl_dir, "SBFv2.tst.csv")}
|
85 |
+
),
|
86 |
+
datasets.SplitGenerator(
|
87 |
+
name=datasets.Split.VALIDATION, gen_kwargs={"filepath": os.path.join(dl_dir, "SBFv2.dev.csv")}
|
88 |
+
),
|
89 |
+
datasets.SplitGenerator(
|
90 |
+
name=datasets.Split.TRAIN, gen_kwargs={"filepath": os.path.join(dl_dir, "SBFv2.trn.csv")}
|
91 |
+
),
|
92 |
+
]
|
93 |
+
|
94 |
+
def _generate_examples(self, filepath):
|
95 |
+
"""This function returns the examples in the raw (text) form."""
|
96 |
+
with open(filepath, encoding="utf-8") as f:
|
97 |
+
reader = csv.DictReader(f)
|
98 |
+
for idx, row in enumerate(reader):
|
99 |
+
yield idx, row
|