Datasets:
Commit
·
863ffbf
1
Parent(s):
12a4e90
Update difraud.py
Browse files- difraud.py +34 -17
difraud.py
CHANGED
@@ -33,31 +33,48 @@ _LICENSE = """
|
|
33 |
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
34 |
"""
|
35 |
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
class DIFrauD(datasets.GeneratorBasedBuilder):
|
38 |
-
"""
|
39 |
-
|
40 |
-
|
41 |
|
42 |
BUILDER_CONFIGS = [
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
description="Collection of rumours from twitter spanning several years and topics"),
|
51 |
]
|
52 |
|
|
|
|
|
53 |
def _info(self):
|
54 |
# This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
55 |
-
features =
|
56 |
-
{
|
57 |
-
"text": datasets.Value("string"),
|
58 |
-
"label": datasets.Value("string"),
|
59 |
-
# These are the features of your dataset ...
|
60 |
-
}
|
61 |
)
|
62 |
return datasets.DatasetInfo(
|
63 |
# This is the description that will appear on the datasets page.
|
|
|
33 |
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
34 |
"""
|
35 |
|
36 |
+
class DIFrauDConfig(datasets.BuilderConfig):
|
37 |
+
def __init__(self, name **kwargs):
|
38 |
+
"""
|
39 |
+
Args:
|
40 |
+
features: `list[string]`, list of the features that will appear in the
|
41 |
+
feature dict. Should not include "label".
|
42 |
+
data_url: `string`, url to download the zip file from.
|
43 |
+
citation: `string`, citation for the data set.
|
44 |
+
url: `string`, url for information about the data set.
|
45 |
+
**kwargs: keyword arguments forwarded to super.
|
46 |
+
"""
|
47 |
+
|
48 |
+
super(SuperGlueConfig, self).__init__(**kwargs)
|
49 |
+
self.name = name
|
50 |
+
self.features = datasets.Features(
|
51 |
+
{
|
52 |
+
"text": datasets.Value("string"),
|
53 |
+
"label": datasets.ClassLabel(num_classes=2, names=['non-deceptive', 'deceptive']),
|
54 |
+
}
|
55 |
+
)
|
56 |
+
|
57 |
class DIFrauD(datasets.GeneratorBasedBuilder):
|
58 |
+
"""Domain Independent Fraud Detection benchmarks -- a Large multi-domain english corpus of truthful and deceptive texts"""
|
59 |
+
V1 = datasets.Version("1.0.0")
|
60 |
+
V2 = datasets.Version("2.0.0")
|
61 |
|
62 |
BUILDER_CONFIGS = [
|
63 |
+
DIFrauDConfig(name="fake_news", version=V2, description="Fake News domain"),
|
64 |
+
DIFrauDConfig(name="job_scams", version=V2, description="Online Job Scams"),
|
65 |
+
DIFrauDConfig(name="phishing", version=V2, description="Email phishing attacks"),
|
66 |
+
DIFrauDConfig(name="political_statements", version=V2, description="Statements by various politicians"),
|
67 |
+
DIFrauDConfig(name="product_reviews", version=V2, description="Amazon product reviews"),
|
68 |
+
DIFrauDConfig(name="sms", version=VERSION, V1="SMS spam and phishing attacks"),
|
69 |
+
DIFrauDConfig(name="twitter_rumours", version=V1,
|
70 |
description="Collection of rumours from twitter spanning several years and topics"),
|
71 |
]
|
72 |
|
73 |
+
DEFAULT_CONFIG_NAME = "phishing"
|
74 |
+
|
75 |
def _info(self):
|
76 |
# This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
|
77 |
+
features = self.config
|
|
|
|
|
|
|
|
|
|
|
78 |
)
|
79 |
return datasets.DatasetInfo(
|
80 |
# This is the description that will appear on the datasets page.
|