zwn22 commited on
Commit
05a7c84
1 Parent(s): a3ceff2

Update NC_Crime.py

Browse files
Files changed (1) hide show
  1. NC_Crime.py +5 -11
NC_Crime.py CHANGED
@@ -73,6 +73,7 @@ class NCCrimeDataset(datasets.GeneratorBasedBuilder):
73
  "clear_status": datasets.Value("string"),
74
  "incident_address": datasets.Value("string"),
75
  "notes": datasets.Value("string"),
 
76
  }),
77
  citation=_CITATION,
78
  )
@@ -81,19 +82,11 @@ class NCCrimeDataset(datasets.GeneratorBasedBuilder):
81
  def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
82
  # Use the raw GitHub link to download the CSV file
83
  downloaded_file_path = dl_manager.download_and_extract(
84
- # https://drive.google.com/file/d/109KUBevJNNC_aKcTmGhjh53c3JrlgTW4/view?usp=drive_link
85
- # "https://drive.google.com/uc?export=download&id=109KUBevJNNC_aKcTmGhjh53c3JrlgTW4"
86
- # "https://drive.google.com/uc?export=download&id=1SdnSc-e3OwzfXgpCZVdZuq2Fq9iCrd21"
87
- # "https://drive.google.com/uc?export=download&id=1C1vwAe4nVTdu6P8lHsmyLbJHUsHfT72h"
88
-
89
- #"https://drive.google.com/uc?export=download&id=1Se-B8Y-SdU0caZzGJyX_0YW44TZwaq3l"
90
-
91
- # "https://raw.githubusercontent.com/znw2024/NC-Crime/main/DCCR.csv"
92
- "https://raw.githubusercontent.com/zening-wang2023/NC-Crime-Dataset/main/DCCR.csv.zip"
93
- # "https://raw.githubusercontent.com/zening-wang2023/NC-Crime-Dataset/main/NC_dataset.csv.zip"
94
 
95
  )
96
- unzipped_file_path = os.path.join(downloaded_file_path, "DCCR.csv")
97
  # Return a list of split generators
98
  return [
99
  datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": unzipped_file_path})
@@ -120,4 +113,5 @@ class NCCrimeDataset(datasets.GeneratorBasedBuilder):
120
  "clear_status": row["clear_status"],
121
  "incident_address": row["incident_address"],
122
  "notes": row["notes"],
 
123
  }
 
73
  "clear_status": datasets.Value("string"),
74
  "incident_address": datasets.Value("string"),
75
  "notes": datasets.Value("string"),
76
+ "crime_severity": datastes.Value("string"),
77
  }),
78
  citation=_CITATION,
79
  )
 
82
  def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
83
  # Use the raw GitHub link to download the CSV file
84
  downloaded_file_path = dl_manager.download_and_extract(
85
+ # "https://raw.githubusercontent.com/zening-wang2023/NC-Crime-Dataset/main/DCCR.csv.zip"
86
+ "https://raw.githubusercontent.com/zening-wang2023/NC-Crime-Dataset/main/NC.csv.zip"
 
 
 
 
 
 
 
 
87
 
88
  )
89
+ unzipped_file_path = os.path.join(downloaded_file_path, "NC.csv")
90
  # Return a list of split generators
91
  return [
92
  datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": unzipped_file_path})
 
113
  "clear_status": row["clear_status"],
114
  "incident_address": row["incident_address"],
115
  "notes": row["notes"],
116
+ "crime_severity": row["crime_severity"],
117
  }