ro-h commited on
Commit
738ff78
1 Parent(s): 9da0cc2

Upload regulatory_comments.py

Browse files
Files changed (1) hide show
  1. regulatory_comments.py +18 -18
regulatory_comments.py CHANGED
@@ -109,24 +109,24 @@ class RegComments(datasets.GeneratorBasedBuilder):
109
  # These kwargs will be passed to _generate_examples
110
  gen_kwargs={
111
  "filepath": os.path.join(data_dir, "train.csv"),
112
- #"split": "train",
113
  },),]
114
 
115
  # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
116
- def _generate_examples(self, filepath):
117
- print("generate examples called")
118
- with open(filepath, encoding="utf-8") as f:
119
- reader = csv.DictReader(f)
120
- for key, row in enumerate(reader):
121
- yield key, {
122
- "docket_agency": row["docket_agency"],
123
- "docket_title": row["docket_title"],
124
- "docket_date": row["docket_date"],
125
- "comment_id": row["comment_id"],
126
- "comment_date": row["comment_date"],
127
- "comment_url": row["comment_url"],
128
- "comment_title": row["comment_title"],
129
- "commenter_name": row["commenter_name"],
130
- "comment_length": int(row["comment_length"]),
131
- "comment_text": row["comment_text"],
132
- }
 
109
  # These kwargs will be passed to _generate_examples
110
  gen_kwargs={
111
  "filepath": os.path.join(data_dir, "train.csv"),
112
+ "split": "train",
113
  },),]
114
 
115
  # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
116
+ # def _generate_examples(self, filepath):
117
+ # print("generate examples called")
118
+ # with open(filepath, encoding="utf-8") as f:
119
+ # reader = csv.DictReader(f)
120
+ # for key, row in enumerate(reader):
121
+ # yield key, {
122
+ # "docket_agency": row["docket_agency"],
123
+ # "docket_title": row["docket_title"],
124
+ # "docket_date": row["docket_date"],
125
+ # "comment_id": row["comment_id"],
126
+ # "comment_date": row["comment_date"],
127
+ # "comment_url": row["comment_url"],
128
+ # "comment_title": row["comment_title"],
129
+ # "commenter_name": row["commenter_name"],
130
+ # "comment_length": int(row["comment_length"]),
131
+ # "comment_text": row["comment_text"],
132
+ # }