Datasets:
Commit ·
4e1261d
1
Parent(s): 884e054
Update difraud.py
Browse files- difraud.py +8 -3
difraud.py
CHANGED
|
@@ -36,7 +36,7 @@ _LICENSE = """
|
|
| 36 |
|
| 37 |
class DIFrauD(datasets.GeneratorBasedBuilder):
|
| 38 |
"""Domain Independent Fraud Detection benchmarks -- a Large multi-domain english corpus of truthful and deceptive texts"""
|
| 39 |
-
|
| 40 |
BUILDER_CONFIGS = [
|
| 41 |
datasets.BuilderConfig(name="fake_news", description="Fake News domain"),
|
| 42 |
datasets.BuilderConfig(name="job_scams", description="Online Job Scams"),
|
|
@@ -51,13 +51,18 @@ class DIFrauD(datasets.GeneratorBasedBuilder):
|
|
| 51 |
DEFAULT_CONFIG_NAME = "phishing"
|
| 52 |
|
| 53 |
def _info(self):
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
return datasets.DatasetInfo(
|
| 56 |
config_name=self.config.name,
|
| 57 |
# This is the description that will appear on the datasets page.
|
| 58 |
description=_DESCRIPTION,
|
| 59 |
# This defines the different columns of the dataset and their types
|
| 60 |
-
features=self.
|
| 61 |
# If there's a common (input, target) tuple from the features, uncomment supervised_keys line below and
|
| 62 |
# specify them. They'll be used if as_supervised=True in builder.as_dataset.
|
| 63 |
supervised_keys=("text", "label"),
|
|
|
|
| 36 |
|
| 37 |
class DIFrauD(datasets.GeneratorBasedBuilder):
|
| 38 |
"""Domain Independent Fraud Detection benchmarks -- a Large multi-domain english corpus of truthful and deceptive texts"""
|
| 39 |
+
|
| 40 |
BUILDER_CONFIGS = [
|
| 41 |
datasets.BuilderConfig(name="fake_news", description="Fake News domain"),
|
| 42 |
datasets.BuilderConfig(name="job_scams", description="Online Job Scams"),
|
|
|
|
| 51 |
DEFAULT_CONFIG_NAME = "phishing"
|
| 52 |
|
| 53 |
def _info(self):
|
| 54 |
+
self.features = datasets.Features(
|
| 55 |
+
{
|
| 56 |
+
"text": datasets.Value("string"),
|
| 57 |
+
"label": datasets.ClassLabel(num_classes=2, names=['non-deceptive', 'deceptive']),
|
| 58 |
+
}
|
| 59 |
+
)
|
| 60 |
return datasets.DatasetInfo(
|
| 61 |
config_name=self.config.name,
|
| 62 |
# This is the description that will appear on the datasets page.
|
| 63 |
description=_DESCRIPTION,
|
| 64 |
# This defines the different columns of the dataset and their types
|
| 65 |
+
features=self.features, # Here we define them above because they are different between the two configurations
|
| 66 |
# If there's a common (input, target) tuple from the features, uncomment supervised_keys line below and
|
| 67 |
# specify them. They'll be used if as_supervised=True in builder.as_dataset.
|
| 68 |
supervised_keys=("text", "label"),
|