Datasets:
Tasks:
Text Classification
Formats:
csv
Sub-tasks:
sentiment-classification
Languages:
English
Size:
10K - 100K
License:
Francisco Castillo
commited on
Commit
•
0f84598
1
Parent(s):
5d24adc
wip
Browse files- reviews_with_drift.py +4 -3
reviews_with_drift.py
CHANGED
@@ -61,7 +61,7 @@ _URLS = {
|
|
61 |
|
62 |
|
63 |
# TODO: Name of the dataset usually match the script name with CamelCase instead of snake_case
|
64 |
-
class
|
65 |
"""TODO: Short description of my dataset."""
|
66 |
|
67 |
VERSION = datasets.Version("1.0.0")
|
@@ -84,6 +84,7 @@ class NewDataset(datasets.GeneratorBasedBuilder):
|
|
84 |
DEFAULT_CONFIG_NAME = "default" # It's not mandatory to have a default configuration. Just use one if it make sense.
|
85 |
|
86 |
def _info(self):
|
|
|
87 |
# This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
88 |
features = datasets.Features(
|
89 |
# These are the features of your dataset like images, labels ...
|
@@ -93,7 +94,7 @@ class NewDataset(datasets.GeneratorBasedBuilder):
|
|
93 |
"gender":datasets.Value("string"),
|
94 |
"context":datasets.Value("string"),
|
95 |
"text":datasets.Value("string"),
|
96 |
-
"label":datasets.features.ClassLabel(names=
|
97 |
}
|
98 |
)
|
99 |
|
@@ -162,5 +163,5 @@ class NewDataset(datasets.GeneratorBasedBuilder):
|
|
162 |
"gender":gender,
|
163 |
"context":context,
|
164 |
"text": text,
|
165 |
-
"label":
|
166 |
}
|
|
|
61 |
|
62 |
|
63 |
# TODO: Name of the dataset usually match the script name with CamelCase instead of snake_case
|
64 |
+
class ReviewsWithDrift(datasets.GeneratorBasedBuilder):
|
65 |
"""TODO: Short description of my dataset."""
|
66 |
|
67 |
VERSION = datasets.Version("1.0.0")
|
|
|
84 |
DEFAULT_CONFIG_NAME = "default" # It's not mandatory to have a default configuration. Just use one if it make sense.
|
85 |
|
86 |
def _info(self):
|
87 |
+
class_names = ["Negative", "Positive"]
|
88 |
# This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
89 |
features = datasets.Features(
|
90 |
# These are the features of your dataset like images, labels ...
|
|
|
94 |
"gender":datasets.Value("string"),
|
95 |
"context":datasets.Value("string"),
|
96 |
"text":datasets.Value("string"),
|
97 |
+
"label":datasets.features.ClassLabel(names=class_names),
|
98 |
}
|
99 |
)
|
100 |
|
|
|
163 |
"gender":gender,
|
164 |
"context":context,
|
165 |
"text": text,
|
166 |
+
"label":label,
|
167 |
}
|