Commit ·
2eff270
1
Parent(s): 3115a3e
Update CIC-IDS2017.py
Browse files- CIC-IDS2017.py +7 -7
CIC-IDS2017.py
CHANGED
|
@@ -56,10 +56,10 @@ class CICIDS2017(datasets.GeneratorBasedBuilder):
|
|
| 56 |
]
|
| 57 |
|
| 58 |
def _generate_examples(self, filepath):
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
|
|
|
| 56 |
]
|
| 57 |
|
| 58 |
def _generate_examples(self, filepath):
|
| 59 |
+
with open(filepath, encoding="utf-8") as csv_file:
|
| 60 |
+
csv_reader = csv.DictReader(csv_file)
|
| 61 |
+
for id_, row in enumerate(csv_reader):
|
| 62 |
+
yield id_, {
|
| 63 |
+
'flow_id': row['flow_id'],
|
| 64 |
+
'attack_label': row['attack_label']
|
| 65 |
+
}
|