Delete dga-detection.py
Browse files- dga-detection.py +0 -67
dga-detection.py
DELETED
@@ -1,67 +0,0 @@
|
|
1 |
-
import datasets
|
2 |
-
import pandas as pd
|
3 |
-
import os
|
4 |
-
|
5 |
-
|
6 |
-
class MyDataset(datasets.GeneratorBasedBuilder):
|
7 |
-
def _info(self):
|
8 |
-
|
9 |
-
return datasets.DatasetInfo(
|
10 |
-
description="DESCRIPTION",
|
11 |
-
features=datasets.Features(
|
12 |
-
{"domain": datasets.Value("string"), "label": datasets.Value("string")}
|
13 |
-
),
|
14 |
-
supervised_keys=("domain", "label"),
|
15 |
-
homepage="_HOMEPAGE",
|
16 |
-
)
|
17 |
-
|
18 |
-
|
19 |
-
def _split_generators(self, dl_manager: DownloadConfig):
|
20 |
-
# Load your local dataset file
|
21 |
-
csv_path = "https://huggingface.co/datasets/harpomaxx/dga-detection/raw/main/argencon.csv.gz"
|
22 |
-
|
23 |
-
return [
|
24 |
-
datasets.SplitGenerator(
|
25 |
-
name=split,
|
26 |
-
gen_kwargs={
|
27 |
-
"filepath": csv_path,
|
28 |
-
"split": split,
|
29 |
-
},
|
30 |
-
)
|
31 |
-
for split in ["train", "test", "validation"]
|
32 |
-
]
|
33 |
-
|
34 |
-
def _generate_examples(
|
35 |
-
self,
|
36 |
-
filepath: str,
|
37 |
-
split: str,
|
38 |
-
):
|
39 |
-
# Read your CSV dataset
|
40 |
-
dataset = pd.read_csv(filepath)
|
41 |
-
|
42 |
-
# Filter your dataset based on the 'split' argument
|
43 |
-
dataset = dataset[dataset["split"] == split]
|
44 |
-
|
45 |
-
# Generate examples
|
46 |
-
for index, row in dataset.iterrows():
|
47 |
-
yield index, {
|
48 |
-
"domain": row["domain"],
|
49 |
-
"label": row["label"],
|
50 |
-
}
|
51 |
-
|
52 |
-
def _oldgenerate_examples(
|
53 |
-
self,
|
54 |
-
filepath: str,
|
55 |
-
split: str,
|
56 |
-
):
|
57 |
-
# Read your CSV dataset
|
58 |
-
dataset = pd.read_csv(filepath)
|
59 |
-
|
60 |
-
# You can filter or split your dataset based on the 'split' argument if necessary
|
61 |
-
|
62 |
-
# Generate examples
|
63 |
-
for index, row in dataset.iterrows():
|
64 |
-
yield index, {
|
65 |
-
"domain": row["domain"],
|
66 |
-
"label": row["label"],
|
67 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|