lukemelas commited on
Commit
d618589
1 Parent(s): 87d4f1f
Files changed (1) hide show
  1. test-dataset-debug.py +4 -5
test-dataset-debug.py CHANGED
@@ -166,9 +166,8 @@ class Patents(datasets.GeneratorBasedBuilder):
166
 
167
  # Download metadata
168
  # NOTE: Metadata is stored as a Pandas DataFrame in Apache Feather format
169
- downloaded_metadata_file = dl_manager.download_and_extract(self.config.metadata_url)
170
- metadata_file = Path(downloaded_metadata_file)
171
- print(f'Using metadata file: {self.config.data_files}')
172
 
173
  # Download data
174
  # NOTE: The extracted path contains a subfolder, data_dir. This directory holds
@@ -178,7 +177,7 @@ class Patents(datasets.GeneratorBasedBuilder):
178
 
179
  # Load metadata file
180
  print(f'Reading metadata file: {metadata_file}')
181
- df = pd.read_feather(metadata_file) # pd.read_pickle(metadata_file) #
182
 
183
  # Filter based on ICPR / CPC label
184
  if self.config.ipcr_label:
@@ -268,7 +267,7 @@ class Patents(datasets.GeneratorBasedBuilder):
268
 
269
  # JSON files are named by application number (unique)
270
  application_number = x.application_number
271
- filepath = json_dir / (application_number + '.json')
272
  try:
273
  with open(filepath, 'r') as f:
274
  patent = json.load(f)
 
166
 
167
  # Download metadata
168
  # NOTE: Metadata is stored as a Pandas DataFrame in Apache Feather format
169
+ metadata_file = dl_manager.download_and_extract(self.config.metadata_url)
170
+ print(f'Using metadata file: {metadata_file}')
 
171
 
172
  # Download data
173
  # NOTE: The extracted path contains a subfolder, data_dir. This directory holds
 
177
 
178
  # Load metadata file
179
  print(f'Reading metadata file: {metadata_file}')
180
+ df = pd.read_feather(metadata_file)
181
 
182
  # Filter based on ICPR / CPC label
183
  if self.config.ipcr_label:
 
267
 
268
  # JSON files are named by application number (unique)
269
  application_number = x.application_number
270
+ filepath = os.path.join(json_dir, application_number + '.json')
271
  try:
272
  with open(filepath, 'r') as f:
273
  patent = json.load(f)