Yijun Xiao commited on
Commit
b11f1fe
·
1 Parent(s): 5e9d12e

Added Amazon Binary and Wikipedia Toxicity

Browse files
Files changed (1) hide show
  1. qb.py +43 -0
qb.py CHANGED
@@ -11,17 +11,23 @@ _DESCRIPTION = """
11
  _URLS = {
12
  "ccd": "https://drive.google.com/u/0/uc?id=13UYcJ6BcojsCKy-yc9qgHTyBMCCWB-w1&export=download",
13
  "clothing": "https://drive.google.com/u/0/uc?id=1BwDS30xzFEDqP-z9adj4wVSlsSjOIGqc&export=download",
 
14
  "electronics": "https://drive.google.com/u/0/uc?id=1ztIUsraLPJSKkkle_uTrd78hYsSKKmur&export=download",
 
15
  "office": "https://drive.google.com/u/0/uc?id=1DbrvS02d75sXoxaaPh90bJdRvr15fUS5&export=download",
 
 
16
  }
17
 
18
  _FIELDS = {
19
  "amazon": ["date", "rating", "reviewText", "summary"],
20
  "ccd": ["date", "product", "subproduct", "issue", "subissue", "text"],
 
21
  }
22
 
23
  _LABELS = {
24
  "amazon": ["1", "2", "3", "4", "5"],
 
25
  "ccd": [
26
  "Checking or savings account",
27
  "Credit card or prepaid card",
@@ -33,6 +39,7 @@ _LABELS = {
33
  "Student loan",
34
  "Vehicle loan or lease",
35
  ],
 
36
  }
37
 
38
 
@@ -74,6 +81,15 @@ class QB(datasets.GeneratorBasedBuilder):
74
  label_column="rating",
75
  text_column="reviewText",
76
  ),
 
 
 
 
 
 
 
 
 
77
  QBConfig(
78
  name="electronics",
79
  description="Amazon Reviews (Electronics)",
@@ -83,6 +99,15 @@ class QB(datasets.GeneratorBasedBuilder):
83
  label_column="rating",
84
  text_column="reviewText",
85
  ),
 
 
 
 
 
 
 
 
 
86
  QBConfig(
87
  name="office",
88
  description="Amazon Reviews (Office)",
@@ -92,6 +117,24 @@ class QB(datasets.GeneratorBasedBuilder):
92
  label_column="rating",
93
  text_column="reviewText",
94
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  ]
96
 
97
  def _info(self):
 
11
  _URLS = {
12
  "ccd": "https://drive.google.com/u/0/uc?id=13UYcJ6BcojsCKy-yc9qgHTyBMCCWB-w1&export=download",
13
  "clothing": "https://drive.google.com/u/0/uc?id=1BwDS30xzFEDqP-z9adj4wVSlsSjOIGqc&export=download",
14
+ "clothing_binary": "https://drive.google.com/u/0/uc?id=1P5aPKD0wU1NWUlh2QiIYwSPN-S3wD3ua&export=download",
15
  "electronics": "https://drive.google.com/u/0/uc?id=1ztIUsraLPJSKkkle_uTrd78hYsSKKmur&export=download",
16
+ "electronics_binary": "https://drive.google.com/u/0/uc?id=103kJN6snOc2sSMH9ojd_PNohVQ1g4XUJ&export=download",
17
  "office": "https://drive.google.com/u/0/uc?id=1DbrvS02d75sXoxaaPh90bJdRvr15fUS5&export=download",
18
+ "office_binary": "https://drive.google.com/u/0/uc?id=1ED4JnoTFu_4H80jBUJlqRrEor-taZ2Qz&export=download",
19
+ "toxicity": "https://drive.google.com/u/0/uc?id=1iATGRaGuOqiUrj31jYjAzns8iS_BJh1h&export=download",
20
  }
21
 
22
  _FIELDS = {
23
  "amazon": ["date", "rating", "reviewText", "summary"],
24
  "ccd": ["date", "product", "subproduct", "issue", "subissue", "text"],
25
+ "toxicity": ["rev_id", "toxicity", "year", "comment", "sample"],
26
  }
27
 
28
  _LABELS = {
29
  "amazon": ["1", "2", "3", "4", "5"],
30
+ "amazon_binary": ["0", "1"],
31
  "ccd": [
32
  "Checking or savings account",
33
  "Credit card or prepaid card",
 
39
  "Student loan",
40
  "Vehicle loan or lease",
41
  ],
42
+ "toxicity": [0, 1],
43
  }
44
 
45
 
 
81
  label_column="rating",
82
  text_column="reviewText",
83
  ),
84
+ QBConfig(
85
+ name="clothing_binary",
86
+ description="Amazon Reviews (Clothing) with binary labels",
87
+ url=_URLS["clothing_binary"],
88
+ csv_fields=_FIELDS["amazon"],
89
+ label_classes=_LABELS["amazon_binary"],
90
+ label_column="rating",
91
+ text_column="reviewText",
92
+ ),
93
  QBConfig(
94
  name="electronics",
95
  description="Amazon Reviews (Electronics)",
 
99
  label_column="rating",
100
  text_column="reviewText",
101
  ),
102
+ QBConfig(
103
+ name="electronics_binary",
104
+ description="Amazon Reviews (Electronics) with binary labels",
105
+ url=_URLS["electronics_binary"],
106
+ csv_fields=_FIELDS["amazon"],
107
+ label_classes=_LABELS["amazon_binary"],
108
+ label_column="rating",
109
+ text_column="reviewText",
110
+ ),
111
  QBConfig(
112
  name="office",
113
  description="Amazon Reviews (Office)",
 
117
  label_column="rating",
118
  text_column="reviewText",
119
  ),
120
+ QBConfig(
121
+ name="office_binary",
122
+ description="Amazon Reviews (Office) with binary labels",
123
+ url=_URLS["office_binary"],
124
+ csv_fields=_FIELDS["amazon"],
125
+ label_classes=_LABELS["amazon_binary"],
126
+ label_column="rating",
127
+ text_column="reviewText",
128
+ ),
129
+ QBConfig(
130
+ name="toxicity",
131
+ description="Wikipedia toxicity data set",
132
+ url=_URLS["toxicity"],
133
+ csv_fields=_FIELDS["toxicity"],
134
+ label_classes=_LABELS["toxicity"],
135
+ label_column="toxicity",
136
+ text_column="comment",
137
+ ),
138
  ]
139
 
140
  def _info(self):