yes-man-today commited on
Commit
62feb9d
1 Parent(s): 5c25b73

resolving generation problem

Browse files
Files changed (1) hide show
  1. regulatory_comments.py +13 -31
regulatory_comments.py CHANGED
@@ -42,24 +42,6 @@ _URLS = {"url": "https://huggingface.co/datasets/ro-h/regulatory_comments/raw/ma
42
  class RegComments(datasets.GeneratorBasedBuilder):
43
 
44
  VERSION = datasets.Version("1.1.0")
45
-
46
- # This is an example of a dataset with multiple configurations.
47
- # If you don't want/need to define several sub-sets in your dataset,
48
- # just remove the BUILDER_CONFIG_CLASS and the BUILDER_CONFIGS attributes.
49
-
50
- # If you need to make complex sub-parts in the datasets with configurable options
51
- # You can create your own builder configuration class to store attribute, inheriting from datasets.BuilderConfig
52
- # BUILDER_CONFIG_CLASS = MyBuilderConfig
53
-
54
- # You will be able to load one or the other configurations in the following list with
55
- # data = datasets.load_dataset('my_dataset', 'first_domain')
56
- # data = datasets.load_dataset('my_dataset', 'second_domain')
57
-
58
- #my_dataset[comment_id] = dict(
59
- # comment_url = comment['links']['self'],
60
- # comment_text = comment_data['data']['attributes']['comment'],
61
- # commenter_name = comment_data['data']['attributes'].get('firstName', '') + " " + comment_data['data']['attributes'].get('lastName', '')
62
- # ) #use pandas
63
 
64
  def _info(self):
65
  features = datasets.Features({
@@ -114,19 +96,19 @@ class RegComments(datasets.GeneratorBasedBuilder):
114
  docket_context = docket["context"]
115
  docket_purpose = docket["purpose"]
116
  docket_keywords = docket["keywords"]
117
- comments = docket["comments"]
118
- # for comment in docket["comments"]:
119
- # comment_data = {
120
- # "text": comment["text"],
121
- # "comment_id": comment["comment_id"],
122
- # "comment_url": comment["comment_url"],
123
- # "comment_date": comment["comment_date"],
124
- # "comment_title": comment["comment_title"],
125
- # "commenter_fname": comment["commenter_fname"],
126
- # "commenter_lname": comment["commenter_lname"],
127
- # "comment_length": comment["comment_length"]
128
- # }
129
- # comments.append(comment_data)
130
 
131
  yield key, {
132
  "id": docket_id,
 
42
  class RegComments(datasets.GeneratorBasedBuilder):
43
 
44
  VERSION = datasets.Version("1.1.0")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
  def _info(self):
47
  features = datasets.Features({
 
96
  docket_context = docket["context"]
97
  docket_purpose = docket["purpose"]
98
  docket_keywords = docket["keywords"]
99
+ comments = []
100
+ for comment in docket["comments"]:
101
+ comment_data = {
102
+ "text": comment["text"],
103
+ "comment_id": comment["comment_id"],
104
+ "comment_url": comment["comment_url"],
105
+ "comment_date": comment["comment_date"],
106
+ "comment_title": comment["comment_title"],
107
+ "commenter_fname": comment["commenter_fname"],
108
+ "commenter_lname": comment["commenter_lname"],
109
+ "comment_length": comment["comment_length"]
110
+ }
111
+ comments.append(comment_data)
112
 
113
  yield key, {
114
  "id": docket_id,