Update NYC_Motor_Vehicle_Collisions_and_Weather_Dataset.py
Browse files
NYC_Motor_Vehicle_Collisions_and_Weather_Dataset.py
CHANGED
@@ -10,7 +10,7 @@ from botocore import UNSIGNED
|
|
10 |
_CITATION = """\
|
11 |
@misc{ny_motor_vehicle_collisions_weather_dataset,
|
12 |
title={New York City Motor Vehicle Collisions and Weather Dataset},
|
13 |
-
author={
|
14 |
year={2024},
|
15 |
url={https://huggingface.co/datasets/xx103/NYC_Motor_Vehicle_Collisions_and_Weather_Dataset},
|
16 |
}
|
@@ -26,6 +26,12 @@ _HOMEPAGE = "https://huggingface.co/datasets/xx103/NYC_Motor_Vehicle_Collisions_
|
|
26 |
|
27 |
_LICENSE = "Apache License 2.0"
|
28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
class NYCMotorVehicleCollisionsWeatherDataset(datasets.GeneratorBasedBuilder):
|
30 |
VERSION = datasets.Version("1.0.0")
|
31 |
|
@@ -59,13 +65,7 @@ class NYCMotorVehicleCollisionsWeatherDataset(datasets.GeneratorBasedBuilder):
|
|
59 |
|
60 |
def _split_generators(self, dl_manager):
|
61 |
s3 = boto3.client('s3', config=Config(signature_version=UNSIGNED))
|
62 |
-
|
63 |
-
bucket_name = 'sta663data1'
|
64 |
-
file_key = 'NYC_Motor_Vehicle_Collisions_and_Weather_Dataset.json'
|
65 |
-
local_file_name = 'NYC_Motor_Vehicle_Collisions_and_Weather_Dataset.json'
|
66 |
-
|
67 |
-
s3.download_file(bucket_name, file_key, local_file_name)
|
68 |
-
|
69 |
return [
|
70 |
datasets.SplitGenerator(
|
71 |
name=datasets.Split.TRAIN,
|
|
|
10 |
_CITATION = """\
|
11 |
@misc{ny_motor_vehicle_collisions_weather_dataset,
|
12 |
title={New York City Motor Vehicle Collisions and Weather Dataset},
|
13 |
+
author={Xingzhi Xie},
|
14 |
year={2024},
|
15 |
url={https://huggingface.co/datasets/xx103/NYC_Motor_Vehicle_Collisions_and_Weather_Dataset},
|
16 |
}
|
|
|
26 |
|
27 |
_LICENSE = "Apache License 2.0"
|
28 |
|
29 |
+
# The dataset is stored in AWS S3 bucket
|
30 |
+
_BUCKET_NAME = 'sta663data1'
|
31 |
+
_FILE_KEY = 'NYC_Motor_Vehicle_Collisions_and_Weather_Dataset.json'
|
32 |
+
_LOCAL_FILE_NAME = 'NYC_Motor_Vehicle_Collisions_and_Weather_Dataset.json'
|
33 |
+
|
34 |
+
|
35 |
class NYCMotorVehicleCollisionsWeatherDataset(datasets.GeneratorBasedBuilder):
|
36 |
VERSION = datasets.Version("1.0.0")
|
37 |
|
|
|
65 |
|
66 |
def _split_generators(self, dl_manager):
|
67 |
s3 = boto3.client('s3', config=Config(signature_version=UNSIGNED))
|
68 |
+
s3.download_file(_BUCKET_NAME, _FILE_KEY, _LOCAL_FILE_NAME)
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
return [
|
70 |
datasets.SplitGenerator(
|
71 |
name=datasets.Split.TRAIN,
|