ro-h commited on
Commit
17fc687
1 Parent(s): bc687a2

Upload regulatory_comments.py

Browse files
Files changed (1) hide show
  1. regulatory_comments.py +12 -6
regulatory_comments.py CHANGED
@@ -30,21 +30,23 @@ and comment text.
30
  _HOMEPAGE = "https://www.regulations.gov/"
31
 
32
  # URL to download the dataset
33
- _URLS = {"url": "https://huggingface.co/datasets/ro-h/regulatory_comments/raw/main/docket_comments_v3.json"}
34
 
35
  # Class definition for handling the dataset
36
  class RegComments(datasets.GeneratorBasedBuilder):
37
 
38
  # Version of the dataset
39
- VERSION = datasets.Version("1.1.0")
40
 
41
  # Method to define the structure of the dataset
42
  def _info(self):
43
  # Defining the structure of the dataset
44
  features = datasets.Features({
45
  "id": datasets.Value("string"),
 
46
  "title": datasets.Value("string"),
47
- "context": datasets.Value("string"),
 
48
  "purpose": datasets.Value("string"),
49
  "keywords": datasets.Sequence(datasets.Value("string")),
50
  "comments": datasets.Sequence({
@@ -52,7 +54,7 @@ class RegComments(datasets.GeneratorBasedBuilder):
52
  "comment_id": datasets.Value("string"),
53
  "comment_url": datasets.Value("string"),
54
  "comment_date": datasets.Value("string"),
55
- "comment_title": datasets.Value("string"),
56
  "commenter_fname": datasets.Value("string"),
57
  "commenter_lname": datasets.Value("string"),
58
  "comment_length": datasets.Value("int32")
@@ -89,8 +91,10 @@ class RegComments(datasets.GeneratorBasedBuilder):
89
  for docket in data:
90
  # Extracting data fields from each docket
91
  docket_id = docket["id"]
 
92
  docket_title = docket["title"]
93
- docket_context = docket["context"]
 
94
  docket_purpose = docket.get("purpose", "unspecified")
95
  docket_keywords = docket.get("keywords", [])
96
  comments = docket["comments"]
@@ -98,8 +102,10 @@ class RegComments(datasets.GeneratorBasedBuilder):
98
  # Yielding each docket with its information
99
  yield key, {
100
  "id": docket_id,
 
101
  "title": docket_title,
102
- "context": docket_context,
 
103
  "purpose": docket_purpose,
104
  "keywords": docket_keywords,
105
  "comments": comments
 
30
  _HOMEPAGE = "https://www.regulations.gov/"
31
 
32
  # URL to download the dataset
33
+ _URLS = {"url": "https://huggingface.co/datasets/ro-h/regulatory_comments/raw/main/docket_comments_v4.json"}
34
 
35
  # Class definition for handling the dataset
36
  class RegComments(datasets.GeneratorBasedBuilder):
37
 
38
  # Version of the dataset
39
+ VERSION = datasets.Version("1.1.4")
40
 
41
  # Method to define the structure of the dataset
42
  def _info(self):
43
  # Defining the structure of the dataset
44
  features = datasets.Features({
45
  "id": datasets.Value("string"),
46
+ "agency": datasets.Value("string"), #Added In
47
  "title": datasets.Value("string"),
48
+ "update_date": datasets.Value("string"), #Added In
49
+ "update_time": datasets.Value("string"), #Added In
50
  "purpose": datasets.Value("string"),
51
  "keywords": datasets.Sequence(datasets.Value("string")),
52
  "comments": datasets.Sequence({
 
54
  "comment_id": datasets.Value("string"),
55
  "comment_url": datasets.Value("string"),
56
  "comment_date": datasets.Value("string"),
57
+ "comment_time": datasets.Value("string"),
58
  "commenter_fname": datasets.Value("string"),
59
  "commenter_lname": datasets.Value("string"),
60
  "comment_length": datasets.Value("int32")
 
91
  for docket in data:
92
  # Extracting data fields from each docket
93
  docket_id = docket["id"]
94
+ docket_agency = docket["agency"]
95
  docket_title = docket["title"]
96
+ docket_update_date = docket["update_date"]
97
+ docket_update_time = docket["update_time"]
98
  docket_purpose = docket.get("purpose", "unspecified")
99
  docket_keywords = docket.get("keywords", [])
100
  comments = docket["comments"]
 
102
  # Yielding each docket with its information
103
  yield key, {
104
  "id": docket_id,
105
+ "agency": docket_agency,
106
  "title": docket_title,
107
+ "update_date": docket_update_date,
108
+ "update_time": docket_update_time,
109
  "purpose": docket_purpose,
110
  "keywords": docket_keywords,
111
  "comments": comments